@openclaw/msteams 2026.6.5 → 2026.6.6-beta.1

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 (1196) hide show
  1. package/dist/api.js +1 -1
  2. package/dist/{channel--oT3fyD5.js → channel-FzXHnZIM.js} +16 -2
  3. package/dist/channel-plugin-api.js +1 -1
  4. package/dist/{channel.runtime-KNuY2Oaw.js → channel.runtime-CaeTVmSx.js} +2 -2
  5. package/dist/{probe-C-rWMb-m.js → probe-D-pKTqs9.js} +1 -1
  6. package/dist/secret-contract-api.js +34 -1
  7. package/dist/{src-CLsoqMj1.js → src-C647R5Nw.js} +2 -2
  8. package/node_modules/@azure/core-client/dist/browser/authorizeRequestOnTenantChallenge.js +1 -2
  9. package/node_modules/@azure/core-client/dist/browser/authorizeRequestOnTenantChallenge.js.map +1 -1
  10. package/node_modules/@azure/core-client/dist/browser/base64.d.ts +2 -6
  11. package/node_modules/@azure/core-client/dist/browser/base64.js +7 -15
  12. package/node_modules/@azure/core-client/dist/browser/base64.js.map +1 -0
  13. package/node_modules/@azure/core-client/dist/browser/index.d.ts +5 -5
  14. package/node_modules/@azure/core-client/dist/browser/index.js.map +1 -1
  15. package/node_modules/@azure/core-client/dist/browser/interfaceHelpers.js +1 -2
  16. package/node_modules/@azure/core-client/dist/browser/interfaceHelpers.js.map +1 -1
  17. package/node_modules/@azure/core-client/dist/browser/operationHelpers.js +8 -4
  18. package/node_modules/@azure/core-client/dist/browser/operationHelpers.js.map +1 -1
  19. package/node_modules/@azure/core-client/dist/browser/serializationPolicy.js +1 -1
  20. package/node_modules/@azure/core-client/dist/browser/serializationPolicy.js.map +1 -1
  21. package/node_modules/@azure/core-client/dist/browser/serializer.js +32 -11
  22. package/node_modules/@azure/core-client/dist/browser/serializer.js.map +1 -1
  23. package/node_modules/@azure/core-client/dist/browser/serviceClient.js +2 -2
  24. package/node_modules/@azure/core-client/dist/browser/serviceClient.js.map +1 -1
  25. package/node_modules/@azure/core-client/dist/browser/{state.d.ts → state-web.d.mts} +1 -1
  26. package/node_modules/@azure/core-client/dist/browser/{state.js → state-web.mjs} +1 -1
  27. package/node_modules/@azure/core-client/dist/browser/state-web.mjs.map +1 -0
  28. package/node_modules/@azure/core-client/dist/browser/urlHelpers.js +2 -1
  29. package/node_modules/@azure/core-client/dist/browser/urlHelpers.js.map +1 -1
  30. package/node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js +1 -2
  31. package/node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js.map +1 -1
  32. package/node_modules/@azure/core-client/dist/commonjs/base64.d.ts +1 -1
  33. package/node_modules/@azure/core-client/dist/commonjs/base64.js +6 -6
  34. package/node_modules/@azure/core-client/dist/commonjs/base64.js.map +1 -1
  35. package/node_modules/@azure/core-client/dist/commonjs/index.d.ts +5 -5
  36. package/node_modules/@azure/core-client/dist/commonjs/index.js.map +1 -1
  37. package/node_modules/@azure/core-client/dist/commonjs/interfaceHelpers.js +1 -2
  38. package/node_modules/@azure/core-client/dist/commonjs/interfaceHelpers.js.map +1 -1
  39. package/node_modules/@azure/core-client/dist/commonjs/operationHelpers.js +10 -6
  40. package/node_modules/@azure/core-client/dist/commonjs/operationHelpers.js.map +1 -1
  41. package/node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js +1 -1
  42. package/node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js.map +1 -1
  43. package/node_modules/@azure/core-client/dist/commonjs/serializer.js +32 -11
  44. package/node_modules/@azure/core-client/dist/commonjs/serializer.js.map +1 -1
  45. package/node_modules/@azure/core-client/dist/commonjs/serviceClient.js +2 -2
  46. package/node_modules/@azure/core-client/dist/commonjs/serviceClient.js.map +1 -1
  47. package/node_modules/@azure/core-client/dist/commonjs/state-cjs.d.ts +8 -0
  48. package/node_modules/@azure/core-client/dist/commonjs/{state.js → state-cjs.js} +1 -1
  49. package/node_modules/@azure/core-client/dist/commonjs/state-cjs.js.map +1 -0
  50. package/node_modules/@azure/core-client/dist/commonjs/tsdoc-metadata.json +1 -1
  51. package/node_modules/@azure/core-client/dist/commonjs/urlHelpers.js +2 -1
  52. package/node_modules/@azure/core-client/dist/commonjs/urlHelpers.js.map +1 -1
  53. package/node_modules/@azure/core-client/dist/esm/authorizeRequestOnTenantChallenge.js +1 -2
  54. package/node_modules/@azure/core-client/dist/esm/authorizeRequestOnTenantChallenge.js.map +1 -1
  55. package/node_modules/@azure/core-client/dist/esm/base64.d.ts +1 -1
  56. package/node_modules/@azure/core-client/dist/esm/base64.js +6 -6
  57. package/node_modules/@azure/core-client/dist/esm/base64.js.map +1 -1
  58. package/node_modules/@azure/core-client/dist/esm/index.d.ts +5 -5
  59. package/node_modules/@azure/core-client/dist/esm/index.js.map +1 -1
  60. package/node_modules/@azure/core-client/dist/esm/interfaceHelpers.js +1 -2
  61. package/node_modules/@azure/core-client/dist/esm/interfaceHelpers.js.map +1 -1
  62. package/node_modules/@azure/core-client/dist/esm/operationHelpers.js +7 -3
  63. package/node_modules/@azure/core-client/dist/esm/operationHelpers.js.map +1 -1
  64. package/node_modules/@azure/core-client/dist/esm/serializationPolicy.js +1 -1
  65. package/node_modules/@azure/core-client/dist/esm/serializationPolicy.js.map +1 -1
  66. package/node_modules/@azure/core-client/dist/esm/serializer.js +32 -11
  67. package/node_modules/@azure/core-client/dist/esm/serializer.js.map +1 -1
  68. package/node_modules/@azure/core-client/dist/esm/serviceClient.js +2 -2
  69. package/node_modules/@azure/core-client/dist/esm/serviceClient.js.map +1 -1
  70. package/node_modules/@azure/core-client/dist/esm/state-cjs.d.ts +8 -0
  71. package/node_modules/@azure/core-client/dist/esm/state-cjs.js +9 -0
  72. package/node_modules/@azure/core-client/dist/esm/state-cjs.js.map +1 -0
  73. package/node_modules/@azure/core-client/dist/esm/state.js +1 -1
  74. package/node_modules/@azure/core-client/dist/esm/state.js.map +1 -1
  75. package/node_modules/@azure/core-client/dist/esm/urlHelpers.js +2 -1
  76. package/node_modules/@azure/core-client/dist/esm/urlHelpers.js.map +1 -1
  77. package/node_modules/@azure/core-client/dist/react-native/authorizeRequestOnTenantChallenge.js +1 -2
  78. package/node_modules/@azure/core-client/dist/react-native/authorizeRequestOnTenantChallenge.js.map +1 -1
  79. package/node_modules/@azure/core-client/dist/react-native/base64.d.ts +1 -1
  80. package/node_modules/@azure/core-client/dist/react-native/base64.js +6 -6
  81. package/node_modules/@azure/core-client/dist/react-native/base64.js.map +1 -1
  82. package/node_modules/@azure/core-client/dist/react-native/index.d.ts +5 -5
  83. package/node_modules/@azure/core-client/dist/react-native/index.js.map +1 -1
  84. package/node_modules/@azure/core-client/dist/react-native/interfaceHelpers.js +1 -2
  85. package/node_modules/@azure/core-client/dist/react-native/interfaceHelpers.js.map +1 -1
  86. package/node_modules/@azure/core-client/dist/react-native/operationHelpers.js +8 -4
  87. package/node_modules/@azure/core-client/dist/react-native/operationHelpers.js.map +1 -1
  88. package/node_modules/@azure/core-client/dist/react-native/serializationPolicy.js +1 -1
  89. package/node_modules/@azure/core-client/dist/react-native/serializationPolicy.js.map +1 -1
  90. package/node_modules/@azure/core-client/dist/react-native/serializer.js +32 -11
  91. package/node_modules/@azure/core-client/dist/react-native/serializer.js.map +1 -1
  92. package/node_modules/@azure/core-client/dist/react-native/serviceClient.js +2 -2
  93. package/node_modules/@azure/core-client/dist/react-native/serviceClient.js.map +1 -1
  94. package/node_modules/@azure/core-client/dist/react-native/state-web.d.mts +8 -0
  95. package/node_modules/@azure/core-client/dist/react-native/state-web.mjs +9 -0
  96. package/node_modules/@azure/core-client/dist/react-native/state-web.mjs.map +1 -0
  97. package/node_modules/@azure/core-client/dist/react-native/urlHelpers.js +2 -1
  98. package/node_modules/@azure/core-client/dist/react-native/urlHelpers.js.map +1 -1
  99. package/node_modules/@azure/core-client/package.json +31 -30
  100. package/node_modules/@azure/core-rest-pipeline/dist/browser/constants.js +1 -1
  101. package/node_modules/@azure/core-rest-pipeline/dist/browser/constants.js.map +1 -1
  102. package/node_modules/@azure/core-rest-pipeline/dist/browser/defaultHttpClient.js.map +1 -1
  103. package/node_modules/@azure/core-rest-pipeline/dist/browser/index.d.ts +1 -12
  104. package/node_modules/@azure/core-rest-pipeline/dist/browser/index.js.map +1 -1
  105. package/node_modules/@azure/core-rest-pipeline/dist/browser/interfaces.d.ts +17 -16
  106. package/node_modules/@azure/core-rest-pipeline/dist/browser/interfaces.js.map +1 -1
  107. package/node_modules/@azure/core-rest-pipeline/dist/browser/policies/bearerTokenAuthenticationPolicy.js +1 -1
  108. package/node_modules/@azure/core-rest-pipeline/dist/browser/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
  109. package/node_modules/@azure/core-rest-pipeline/dist/browser/policies/ndJsonPolicy.js +1 -3
  110. package/node_modules/@azure/core-rest-pipeline/dist/browser/policies/ndJsonPolicy.js.map +1 -1
  111. package/node_modules/@azure/core-rest-pipeline/dist/browser/policies/wrapAbortSignalLikePolicy.js.map +1 -1
  112. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/createFile-browser.d.mts +15 -0
  113. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/createFile-browser.mjs +28 -0
  114. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/createFile-browser.mjs.map +1 -0
  115. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/file.d.ts +12 -16
  116. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/file.js +28 -32
  117. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/file.js.map +1 -1
  118. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/tokenCycler.js +5 -2
  119. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/tokenCycler.js.map +1 -1
  120. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/userAgent.js +1 -1
  121. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/userAgent.js.map +1 -1
  122. package/node_modules/{@typespec/ts-http-runtime/dist/browser/util/userAgentPlatform.d.ts → @azure/core-rest-pipeline/dist/browser/util/userAgentPlatform-browser.d.mts} +1 -1
  123. package/node_modules/{@typespec/ts-http-runtime/dist/browser/util/userAgentPlatform.js → @azure/core-rest-pipeline/dist/browser/util/userAgentPlatform-browser.mjs} +1 -1
  124. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/userAgentPlatform-browser.mjs.map +1 -0
  125. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/wrapAbortSignal.js +4 -2
  126. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/wrapAbortSignal.js.map +1 -1
  127. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js +2 -1
  128. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js.map +2 -2
  129. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js +1 -0
  130. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js.map +1 -1
  131. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js +1 -0
  132. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js.map +2 -2
  133. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js +1 -0
  134. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js.map +1 -1
  135. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/index.d.ts +1 -12
  136. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js +1 -0
  137. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js.map +3 -3
  138. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/interfaces.d.ts +17 -16
  139. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/interfaces.js +1 -0
  140. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/interfaces.js.map +2 -2
  141. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js +1 -0
  142. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js.map +1 -1
  143. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js +1 -0
  144. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js.map +1 -1
  145. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js +1 -0
  146. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js.map +1 -1
  147. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/agentPolicy.js +1 -0
  148. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/agentPolicy.js.map +1 -1
  149. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/auxiliaryAuthenticationHeaderPolicy.js +1 -0
  150. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/auxiliaryAuthenticationHeaderPolicy.js.map +1 -1
  151. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js +2 -1
  152. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js.map +3 -3
  153. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js +1 -0
  154. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js.map +1 -1
  155. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js +1 -0
  156. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js.map +1 -1
  157. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js +1 -0
  158. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js.map +1 -1
  159. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js +1 -0
  160. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js.map +1 -1
  161. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js +1 -0
  162. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js.map +1 -1
  163. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js +1 -0
  164. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js.map +1 -1
  165. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/ndJsonPolicy.js +2 -3
  166. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/ndJsonPolicy.js.map +3 -3
  167. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js +1 -0
  168. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js.map +1 -1
  169. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js +1 -0
  170. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js.map +1 -1
  171. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js +1 -0
  172. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js.map +1 -1
  173. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/setClientRequestIdPolicy.js +1 -0
  174. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/setClientRequestIdPolicy.js.map +1 -1
  175. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js +1 -0
  176. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js.map +1 -1
  177. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js +1 -0
  178. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js.map +1 -1
  179. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js +1 -0
  180. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js.map +1 -1
  181. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tracingPolicy.js +1 -0
  182. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tracingPolicy.js.map +1 -1
  183. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js +1 -0
  184. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js.map +1 -1
  185. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/wrapAbortSignalLikePolicy.js +1 -0
  186. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/wrapAbortSignalLikePolicy.js.map +2 -2
  187. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js +1 -0
  188. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js.map +1 -1
  189. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/tsdoc-metadata.json +1 -1
  190. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/createFile.d.ts +15 -0
  191. package/node_modules/{@typespec/ts-http-runtime/dist/commonjs/util/inspect.common.js → @azure/core-rest-pipeline/dist/commonjs/util/createFile.js} +10 -7
  192. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/createFile.js.map +7 -0
  193. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/file.d.ts +12 -16
  194. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/file.js +25 -20
  195. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/file.js.map +3 -3
  196. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/tokenCycler.js +6 -2
  197. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/tokenCycler.js.map +3 -3
  198. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js +4 -3
  199. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js.map +3 -3
  200. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.d.ts +8 -0
  201. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js +7 -7
  202. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js.map +3 -3
  203. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/wrapAbortSignal.js +7 -2
  204. package/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/wrapAbortSignal.js.map +3 -3
  205. package/node_modules/@azure/core-rest-pipeline/dist/esm/constants.js +1 -1
  206. package/node_modules/@azure/core-rest-pipeline/dist/esm/constants.js.map +1 -1
  207. package/node_modules/@azure/core-rest-pipeline/dist/esm/defaultHttpClient.js.map +1 -1
  208. package/node_modules/@azure/core-rest-pipeline/dist/esm/index.d.ts +1 -12
  209. package/node_modules/@azure/core-rest-pipeline/dist/esm/index.js.map +1 -1
  210. package/node_modules/@azure/core-rest-pipeline/dist/esm/interfaces.d.ts +17 -16
  211. package/node_modules/@azure/core-rest-pipeline/dist/esm/interfaces.js.map +1 -1
  212. package/node_modules/@azure/core-rest-pipeline/dist/esm/policies/bearerTokenAuthenticationPolicy.js +1 -1
  213. package/node_modules/@azure/core-rest-pipeline/dist/esm/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
  214. package/node_modules/@azure/core-rest-pipeline/dist/esm/policies/ndJsonPolicy.js +1 -3
  215. package/node_modules/@azure/core-rest-pipeline/dist/esm/policies/ndJsonPolicy.js.map +1 -1
  216. package/node_modules/@azure/core-rest-pipeline/dist/esm/policies/wrapAbortSignalLikePolicy.js.map +1 -1
  217. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/createFile.d.ts +15 -0
  218. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/createFile.js +19 -0
  219. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/createFile.js.map +1 -0
  220. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/file.d.ts +12 -16
  221. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/file.js +28 -32
  222. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/file.js.map +1 -1
  223. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/tokenCycler.js +5 -2
  224. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/tokenCycler.js.map +1 -1
  225. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/userAgent.js.map +1 -1
  226. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/userAgentPlatform.d.ts +8 -0
  227. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/userAgentPlatform.js +6 -7
  228. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/userAgentPlatform.js.map +1 -1
  229. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/wrapAbortSignal.js +4 -2
  230. package/node_modules/@azure/core-rest-pipeline/dist/esm/util/wrapAbortSignal.js.map +1 -1
  231. package/node_modules/@azure/core-rest-pipeline/dist/react-native/constants.js +1 -1
  232. package/node_modules/@azure/core-rest-pipeline/dist/react-native/constants.js.map +1 -1
  233. package/node_modules/@azure/core-rest-pipeline/dist/react-native/defaultHttpClient.js +1 -1
  234. package/node_modules/@azure/core-rest-pipeline/dist/react-native/defaultHttpClient.js.map +1 -1
  235. package/node_modules/@azure/core-rest-pipeline/dist/react-native/index.d.ts +1 -12
  236. package/node_modules/@azure/core-rest-pipeline/dist/react-native/index.js.map +1 -1
  237. package/node_modules/@azure/core-rest-pipeline/dist/react-native/interfaces.d.ts +17 -16
  238. package/node_modules/@azure/core-rest-pipeline/dist/react-native/interfaces.js.map +1 -1
  239. package/node_modules/@azure/core-rest-pipeline/dist/react-native/policies/bearerTokenAuthenticationPolicy.js +1 -1
  240. package/node_modules/@azure/core-rest-pipeline/dist/react-native/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
  241. package/node_modules/@azure/core-rest-pipeline/dist/react-native/policies/ndJsonPolicy.js +1 -3
  242. package/node_modules/@azure/core-rest-pipeline/dist/react-native/policies/ndJsonPolicy.js.map +1 -1
  243. package/node_modules/@azure/core-rest-pipeline/dist/react-native/policies/wrapAbortSignalLikePolicy.js +1 -1
  244. package/node_modules/@azure/core-rest-pipeline/dist/react-native/policies/wrapAbortSignalLikePolicy.js.map +1 -1
  245. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/createFile-browser.d.mts +15 -0
  246. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/createFile-browser.mjs +28 -0
  247. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/createFile-browser.mjs.map +1 -0
  248. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/file.d.ts +12 -16
  249. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/file.js +28 -32
  250. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/file.js.map +1 -1
  251. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/tokenCycler.js +5 -2
  252. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/tokenCycler.js.map +1 -1
  253. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/userAgent.js +1 -1
  254. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/userAgent.js.map +1 -1
  255. package/node_modules/{@typespec/ts-http-runtime/dist/react-native/util/userAgentPlatform.d.ts → @azure/core-rest-pipeline/dist/react-native/util/userAgentPlatform-react-native.d.mts} +1 -1
  256. package/node_modules/{@typespec/ts-http-runtime/dist/react-native/util/userAgentPlatform.js → @azure/core-rest-pipeline/dist/react-native/util/userAgentPlatform-react-native.mjs} +1 -1
  257. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/userAgentPlatform-react-native.mjs.map +1 -0
  258. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/{wrapAbortSignal.d.ts → wrapAbortSignal-rn.d.mts} +7 -2
  259. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/{wrapAbortSignal.js → wrapAbortSignal-rn.mjs} +11 -5
  260. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/wrapAbortSignal-rn.mjs.map +1 -0
  261. package/node_modules/@azure/core-rest-pipeline/package.json +37 -14
  262. package/node_modules/@azure/msal-browser/dist/app/IPublicClientApplication.mjs +1 -1
  263. package/node_modules/@azure/msal-browser/dist/app/PublicClientApplication.mjs +44 -2
  264. package/node_modules/@azure/msal-browser/dist/app/PublicClientApplication.mjs.map +1 -1
  265. package/node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeStatusCodes.mjs +3 -3
  266. package/node_modules/@azure/msal-browser/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
  267. package/node_modules/@azure/msal-browser/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  268. package/node_modules/@azure/msal-browser/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  269. package/node_modules/@azure/msal-browser/dist/cache/AccountManager.mjs +1 -1
  270. package/node_modules/@azure/msal-browser/dist/cache/AsyncMemoryStorage.mjs +1 -1
  271. package/node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.mjs +12 -1
  272. package/node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.mjs.map +1 -1
  273. package/node_modules/@azure/msal-browser/dist/cache/CacheHelpers.mjs +1 -1
  274. package/node_modules/@azure/msal-browser/dist/cache/CacheKeys.mjs +1 -1
  275. package/node_modules/@azure/msal-browser/dist/cache/CookieStorage.mjs +1 -1
  276. package/node_modules/@azure/msal-browser/dist/cache/DatabaseStorage.mjs +1 -1
  277. package/node_modules/@azure/msal-browser/dist/cache/EncryptedData.mjs +1 -1
  278. package/node_modules/@azure/msal-browser/dist/cache/LocalStorage.mjs +1 -1
  279. package/node_modules/@azure/msal-browser/dist/cache/MemoryStorage.mjs +1 -1
  280. package/node_modules/@azure/msal-browser/dist/cache/SessionStorage.mjs +1 -1
  281. package/node_modules/@azure/msal-browser/dist/cache/TokenCache.mjs +1 -1
  282. package/node_modules/@azure/msal-browser/dist/config/Configuration.mjs +2 -2
  283. package/node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs +1 -1
  284. package/node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs +3 -3
  285. package/node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs.map +1 -1
  286. package/node_modules/@azure/msal-browser/dist/crypto/BrowserCrypto.mjs +1 -1
  287. package/node_modules/@azure/msal-browser/dist/crypto/CryptoOps.mjs +1 -1
  288. package/node_modules/@azure/msal-browser/dist/crypto/PkceGenerator.mjs +1 -1
  289. package/node_modules/@azure/msal-browser/dist/crypto/SignedHttpRequest.mjs +1 -1
  290. package/node_modules/@azure/msal-browser/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  291. package/node_modules/@azure/msal-browser/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  292. package/node_modules/@azure/msal-browser/dist/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
  293. package/node_modules/@azure/msal-browser/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  294. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  295. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  296. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  297. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  298. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  299. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  300. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  301. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  302. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  303. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  304. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  305. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  306. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  307. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  308. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  309. package/node_modules/@azure/msal-browser/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  310. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  311. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  312. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/HttpError.mjs +1 -1
  313. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  314. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  315. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  316. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  317. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  318. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  319. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  320. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  321. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  322. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  323. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  324. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  325. package/node_modules/@azure/msal-browser/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  326. package/node_modules/@azure/msal-browser/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  327. package/node_modules/@azure/msal-browser/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  328. package/node_modules/@azure/msal-browser/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  329. package/node_modules/@azure/msal-browser/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  330. package/node_modules/@azure/msal-browser/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  331. package/node_modules/@azure/msal-browser/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  332. package/node_modules/@azure/msal-browser/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  333. package/node_modules/@azure/msal-browser/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  334. package/node_modules/@azure/msal-browser/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  335. package/node_modules/@azure/msal-browser/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  336. package/node_modules/@azure/msal-browser/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  337. package/node_modules/@azure/msal-browser/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  338. package/node_modules/@azure/msal-browser/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  339. package/node_modules/@azure/msal-browser/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  340. package/node_modules/@azure/msal-browser/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  341. package/node_modules/@azure/msal-browser/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  342. package/node_modules/@azure/msal-browser/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  343. package/node_modules/@azure/msal-browser/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  344. package/node_modules/@azure/msal-browser/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  345. package/node_modules/@azure/msal-browser/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  346. package/node_modules/@azure/msal-browser/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  347. package/node_modules/@azure/msal-browser/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  348. package/node_modules/@azure/msal-browser/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  349. package/node_modules/@azure/msal-browser/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  350. package/node_modules/@azure/msal-browser/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  351. package/node_modules/@azure/msal-browser/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  352. package/node_modules/@azure/msal-browser/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  353. package/node_modules/@azure/msal-browser/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  354. package/node_modules/@azure/msal-browser/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  355. package/node_modules/@azure/msal-browser/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  356. package/node_modules/@azure/msal-browser/dist/custom_auth/index.mjs +1 -1
  357. package/node_modules/@azure/msal-browser/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  358. package/node_modules/@azure/msal-browser/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  359. package/node_modules/@azure/msal-browser/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  360. package/node_modules/@azure/msal-browser/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  361. package/node_modules/@azure/msal-browser/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  362. package/node_modules/@azure/msal-browser/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  363. package/node_modules/@azure/msal-browser/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  364. package/node_modules/@azure/msal-browser/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  365. package/node_modules/@azure/msal-browser/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  366. package/node_modules/@azure/msal-browser/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  367. package/node_modules/@azure/msal-browser/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  368. package/node_modules/@azure/msal-browser/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  369. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  370. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  371. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  372. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  373. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  374. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  375. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  376. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  377. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  378. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  379. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  380. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  381. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  382. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  383. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  384. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  385. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  386. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  387. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  388. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  389. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  390. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  391. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  392. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  393. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  394. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  395. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  396. package/node_modules/@azure/msal-browser/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  397. package/node_modules/@azure/msal-browser/dist/encode/Base64Decode.mjs +1 -1
  398. package/node_modules/@azure/msal-browser/dist/encode/Base64Encode.mjs +1 -1
  399. package/node_modules/@azure/msal-browser/dist/error/BrowserAuthError.mjs +1 -1
  400. package/node_modules/@azure/msal-browser/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  401. package/node_modules/@azure/msal-browser/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  402. package/node_modules/@azure/msal-browser/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  403. package/node_modules/@azure/msal-browser/dist/error/NativeAuthError.mjs +4 -4
  404. package/node_modules/@azure/msal-browser/dist/error/NativeAuthError.mjs.map +1 -1
  405. package/node_modules/@azure/msal-browser/dist/error/NativeAuthErrorCodes.mjs +1 -1
  406. package/node_modules/@azure/msal-browser/dist/error/NestedAppAuthError.mjs +1 -1
  407. package/node_modules/@azure/msal-browser/dist/event/EventHandler.mjs +1 -1
  408. package/node_modules/@azure/msal-browser/dist/event/EventMessage.mjs +1 -1
  409. package/node_modules/@azure/msal-browser/dist/event/EventType.mjs +1 -1
  410. package/node_modules/@azure/msal-browser/dist/index.mjs +1 -1
  411. package/node_modules/@azure/msal-browser/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  412. package/node_modules/@azure/msal-browser/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  413. package/node_modules/@azure/msal-browser/dist/interaction_client/PlatformAuthInteractionClient.mjs +4 -3
  414. package/node_modules/@azure/msal-browser/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  415. package/node_modules/@azure/msal-browser/dist/interaction_client/PopupClient.mjs +27 -7
  416. package/node_modules/@azure/msal-browser/dist/interaction_client/PopupClient.mjs.map +1 -1
  417. package/node_modules/@azure/msal-browser/dist/interaction_client/RedirectClient.mjs +6 -1
  418. package/node_modules/@azure/msal-browser/dist/interaction_client/RedirectClient.mjs.map +1 -1
  419. package/node_modules/@azure/msal-browser/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  420. package/node_modules/@azure/msal-browser/dist/interaction_client/SilentCacheClient.mjs +1 -1
  421. package/node_modules/@azure/msal-browser/dist/interaction_client/SilentIframeClient.mjs +11 -4
  422. package/node_modules/@azure/msal-browser/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  423. package/node_modules/@azure/msal-browser/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  424. package/node_modules/@azure/msal-browser/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  425. package/node_modules/@azure/msal-browser/dist/interaction_handler/InteractionHandler.mjs +1 -1
  426. package/node_modules/@azure/msal-browser/dist/interaction_handler/SilentHandler.mjs +2 -1
  427. package/node_modules/@azure/msal-browser/dist/interaction_handler/SilentHandler.mjs.map +1 -1
  428. package/node_modules/@azure/msal-browser/dist/log-strings-mapping.json +7 -3
  429. package/node_modules/@azure/msal-browser/dist/naa/BridgeError.mjs +1 -1
  430. package/node_modules/@azure/msal-browser/dist/naa/BridgeProxy.mjs +1 -1
  431. package/node_modules/@azure/msal-browser/dist/naa/BridgeStatusCode.mjs +1 -1
  432. package/node_modules/@azure/msal-browser/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  433. package/node_modules/@azure/msal-browser/dist/navigation/NavigationClient.mjs +1 -1
  434. package/node_modules/@azure/msal-browser/dist/network/FetchClient.mjs +1 -1
  435. package/node_modules/@azure/msal-browser/dist/operatingcontext/BaseOperatingContext.mjs +10 -2
  436. package/node_modules/@azure/msal-browser/dist/operatingcontext/BaseOperatingContext.mjs.map +1 -1
  437. package/node_modules/@azure/msal-browser/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  438. package/node_modules/@azure/msal-browser/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  439. package/node_modules/@azure/msal-browser/dist/packageMetadata.mjs +2 -2
  440. package/node_modules/@azure/msal-browser/dist/protocol/Authorize.mjs +1 -1
  441. package/node_modules/@azure/msal-browser/dist/redirect_bridge/index.mjs +4 -5
  442. package/node_modules/@azure/msal-browser/dist/redirect_bridge/index.mjs.map +1 -1
  443. package/node_modules/@azure/msal-browser/dist/request/RequestHelpers.mjs +1 -1
  444. package/node_modules/@azure/msal-browser/dist/response/ResponseHandler.mjs +1 -1
  445. package/node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  446. package/node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
  447. package/node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  448. package/node_modules/@azure/msal-browser/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  449. package/node_modules/@azure/msal-browser/dist/utils/BrowserConstants.mjs +1 -1
  450. package/node_modules/@azure/msal-browser/dist/utils/BrowserProtocolUtils.mjs +1 -1
  451. package/node_modules/@azure/msal-browser/dist/utils/BrowserUtils.mjs +15 -5
  452. package/node_modules/@azure/msal-browser/dist/utils/BrowserUtils.mjs.map +1 -1
  453. package/node_modules/@azure/msal-browser/dist/utils/Helpers.mjs +1 -1
  454. package/node_modules/@azure/msal-browser/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  455. package/node_modules/@azure/msal-browser/lib/custom-auth-path/log-strings-mapping.json +15 -11
  456. package/node_modules/@azure/msal-browser/lib/custom-auth-path/msal-custom-auth.cjs +238 -132
  457. package/node_modules/@azure/msal-browser/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  458. package/node_modules/@azure/msal-browser/lib/custom-auth-path/msal-custom-auth.js +238 -132
  459. package/node_modules/@azure/msal-browser/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  460. package/node_modules/@azure/msal-browser/lib/log-strings-mapping.json +7 -3
  461. package/node_modules/@azure/msal-browser/lib/msal-browser.cjs +252 -135
  462. package/node_modules/@azure/msal-browser/lib/msal-browser.cjs.map +1 -1
  463. package/node_modules/@azure/msal-browser/lib/msal-browser.js +252 -135
  464. package/node_modules/@azure/msal-browser/lib/msal-browser.js.map +1 -1
  465. package/node_modules/@azure/msal-browser/lib/msal-browser.min.js +2 -2
  466. package/node_modules/@azure/msal-browser/lib/redirect-bridge/msal-redirect-bridge.cjs +59 -50
  467. package/node_modules/@azure/msal-browser/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  468. package/node_modules/@azure/msal-browser/lib/redirect-bridge/msal-redirect-bridge.js +59 -50
  469. package/node_modules/@azure/msal-browser/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  470. package/node_modules/@azure/msal-browser/lib/redirect-bridge/msal-redirect-bridge.min.js +2 -2
  471. package/node_modules/@azure/msal-browser/package.json +2 -2
  472. package/node_modules/@azure/msal-browser/src/app/PublicClientApplication.ts +85 -1
  473. package/node_modules/@azure/msal-browser/src/broker/nativeBroker/NativeStatusCodes.ts +1 -1
  474. package/node_modules/@azure/msal-browser/src/cache/BrowserCacheManager.ts +17 -0
  475. package/node_modules/@azure/msal-browser/src/controllers/StandardController.ts +4 -2
  476. package/node_modules/@azure/msal-browser/src/error/NativeAuthError.ts +2 -2
  477. package/node_modules/@azure/msal-browser/src/interaction_client/PlatformAuthInteractionClient.ts +5 -1
  478. package/node_modules/@azure/msal-browser/src/interaction_client/PopupClient.ts +65 -27
  479. package/node_modules/@azure/msal-browser/src/interaction_client/RedirectClient.ts +5 -0
  480. package/node_modules/@azure/msal-browser/src/interaction_client/SilentIframeClient.ts +49 -19
  481. package/node_modules/@azure/msal-browser/src/interaction_handler/SilentHandler.ts +1 -0
  482. package/node_modules/@azure/msal-browser/src/operatingcontext/BaseOperatingContext.ts +15 -1
  483. package/node_modules/@azure/msal-browser/src/packageMetadata.ts +1 -1
  484. package/node_modules/@azure/msal-browser/src/redirect_bridge/index.ts +3 -7
  485. package/node_modules/@azure/msal-browser/src/utils/BrowserUtils.ts +28 -7
  486. package/node_modules/@azure/msal-browser/types/app/PublicClientApplication.d.ts +37 -1
  487. package/node_modules/@azure/msal-browser/types/app/PublicClientApplication.d.ts.map +1 -1
  488. package/node_modules/@azure/msal-browser/types/broker/nativeBroker/NativeStatusCodes.d.ts +1 -1
  489. package/node_modules/@azure/msal-browser/types/cache/BrowserCacheManager.d.ts.map +1 -1
  490. package/node_modules/@azure/msal-browser/types/controllers/StandardController.d.ts.map +1 -1
  491. package/node_modules/@azure/msal-browser/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  492. package/node_modules/@azure/msal-browser/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  493. package/node_modules/@azure/msal-browser/types/interaction_client/PopupClient.d.ts +11 -1
  494. package/node_modules/@azure/msal-browser/types/interaction_client/PopupClient.d.ts.map +1 -1
  495. package/node_modules/@azure/msal-browser/types/interaction_client/RedirectClient.d.ts.map +1 -1
  496. package/node_modules/@azure/msal-browser/types/interaction_client/SilentIframeClient.d.ts +20 -1
  497. package/node_modules/@azure/msal-browser/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  498. package/node_modules/@azure/msal-browser/types/interaction_handler/SilentHandler.d.ts.map +1 -1
  499. package/node_modules/@azure/msal-browser/types/operatingcontext/BaseOperatingContext.d.ts +8 -1
  500. package/node_modules/@azure/msal-browser/types/operatingcontext/BaseOperatingContext.d.ts.map +1 -1
  501. package/node_modules/@azure/msal-browser/types/packageMetadata.d.ts +1 -1
  502. package/node_modules/@azure/msal-browser/types/redirect_bridge/index.d.ts.map +1 -1
  503. package/node_modules/@azure/msal-browser/types/utils/BrowserUtils.d.ts +17 -2
  504. package/node_modules/@azure/msal-browser/types/utils/BrowserUtils.d.ts.map +1 -1
  505. package/node_modules/@azure/msal-common/dist/account/AccountInfo.mjs +1 -1
  506. package/node_modules/@azure/msal-common/dist/account/AuthToken.mjs +1 -1
  507. package/node_modules/@azure/msal-common/dist/account/CcsCredential.mjs +1 -1
  508. package/node_modules/@azure/msal-common/dist/account/ClientInfo.mjs +1 -1
  509. package/node_modules/@azure/msal-common/dist/account/TokenClaims.mjs +1 -1
  510. package/node_modules/@azure/msal-common/dist/authority/Authority.mjs +19 -6
  511. package/node_modules/@azure/msal-common/dist/authority/Authority.mjs.map +1 -1
  512. package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.mjs +1 -1
  513. package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.mjs +1 -1
  514. package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.mjs +1 -1
  515. package/node_modules/@azure/msal-common/dist/authority/AuthorityType.mjs +1 -1
  516. package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
  517. package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
  518. package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.mjs +1 -1
  519. package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.mjs +1 -1
  520. package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.mjs +1 -1
  521. package/node_modules/@azure/msal-common/dist/cache/CacheManager.mjs +3 -3
  522. package/node_modules/@azure/msal-common/dist/cache/CacheManager.mjs.map +1 -1
  523. package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.mjs +1 -1
  524. package/node_modules/@azure/msal-common/dist/cache/utils/AccountEntityUtils.mjs +1 -1
  525. package/node_modules/@azure/msal-common/dist/cache/utils/CacheHelpers.mjs +1 -1
  526. package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.mjs +1 -1
  527. package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.mjs +1 -1
  528. package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.mjs +1 -1
  529. package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.mjs +1 -1
  530. package/node_modules/@azure/msal-common/dist/constants/AADServerParamKeys.mjs +1 -1
  531. package/node_modules/@azure/msal-common/dist/crypto/ICrypto.mjs +1 -1
  532. package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.mjs +1 -1
  533. package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.mjs +1 -1
  534. package/node_modules/@azure/msal-common/dist/error/AuthError.mjs +1 -1
  535. package/node_modules/@azure/msal-common/dist/error/AuthErrorCodes.mjs +1 -1
  536. package/node_modules/@azure/msal-common/dist/error/CacheError.mjs +1 -1
  537. package/node_modules/@azure/msal-common/dist/error/CacheErrorCodes.mjs +1 -1
  538. package/node_modules/@azure/msal-common/dist/error/ClientAuthError.mjs +1 -1
  539. package/node_modules/@azure/msal-common/dist/error/ClientAuthErrorCodes.mjs +1 -1
  540. package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.mjs +1 -1
  541. package/node_modules/@azure/msal-common/dist/error/ClientConfigurationErrorCodes.mjs +1 -1
  542. package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.mjs +4 -4
  543. package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
  544. package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthErrorCodes.mjs +3 -3
  545. package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthErrorCodes.mjs.map +1 -1
  546. package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.mjs +1 -1
  547. package/node_modules/@azure/msal-common/dist/error/JoseHeaderErrorCodes.mjs +1 -1
  548. package/node_modules/@azure/msal-common/dist/error/NetworkError.mjs +1 -1
  549. package/node_modules/@azure/msal-common/dist/error/PlatformBrokerError.mjs +1 -1
  550. package/node_modules/@azure/msal-common/dist/error/ServerError.mjs +1 -1
  551. package/node_modules/@azure/msal-common/dist/index-node.mjs +1 -1
  552. package/node_modules/@azure/msal-common/dist/index.mjs +1 -1
  553. package/node_modules/@azure/msal-common/dist/logger/Logger.mjs +1 -1
  554. package/node_modules/@azure/msal-common/dist/network/INetworkModule.mjs +1 -1
  555. package/node_modules/@azure/msal-common/dist/network/RequestThumbprint.mjs +1 -1
  556. package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.mjs +1 -1
  557. package/node_modules/@azure/msal-common/dist/packageMetadata.mjs +2 -2
  558. package/node_modules/@azure/msal-common/dist/protocol/Authorize.mjs +1 -1
  559. package/node_modules/@azure/msal-common/dist/protocol/Token.mjs +1 -1
  560. package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.mjs +1 -1
  561. package/node_modules/@azure/msal-common/dist/request/BaseAuthRequest.mjs +1 -1
  562. package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.mjs +1 -1
  563. package/node_modules/@azure/msal-common/dist/request/ScopeSet.mjs +1 -1
  564. package/node_modules/@azure/msal-common/dist/response/ResponseHandler.mjs +1 -1
  565. package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.mjs +1 -1
  566. package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.mjs +1 -1
  567. package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvents.mjs +1 -1
  568. package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
  569. package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
  570. package/node_modules/@azure/msal-common/dist/url/UrlString.mjs +1 -1
  571. package/node_modules/@azure/msal-common/dist/utils/ClientAssertionUtils.mjs +1 -1
  572. package/node_modules/@azure/msal-common/dist/utils/Constants.mjs +1 -1
  573. package/node_modules/@azure/msal-common/dist/utils/FunctionWrappers.mjs +1 -1
  574. package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.mjs +1 -1
  575. package/node_modules/@azure/msal-common/dist/utils/StringUtils.mjs +1 -1
  576. package/node_modules/@azure/msal-common/dist/utils/TimeUtils.mjs +1 -1
  577. package/node_modules/@azure/msal-common/dist/utils/UrlUtils.mjs +1 -1
  578. package/node_modules/@azure/msal-common/dist-browser/account/AccountInfo.mjs +1 -1
  579. package/node_modules/@azure/msal-common/dist-browser/account/AuthToken.mjs +1 -1
  580. package/node_modules/@azure/msal-common/dist-browser/account/CcsCredential.mjs +1 -1
  581. package/node_modules/@azure/msal-common/dist-browser/account/ClientInfo.mjs +1 -1
  582. package/node_modules/@azure/msal-common/dist-browser/account/TokenClaims.mjs +1 -1
  583. package/node_modules/@azure/msal-common/dist-browser/authority/Authority.mjs +19 -6
  584. package/node_modules/@azure/msal-common/dist-browser/authority/Authority.mjs.map +1 -1
  585. package/node_modules/@azure/msal-common/dist-browser/authority/AuthorityFactory.mjs +1 -1
  586. package/node_modules/@azure/msal-common/dist-browser/authority/AuthorityMetadata.mjs +1 -1
  587. package/node_modules/@azure/msal-common/dist-browser/authority/AuthorityOptions.mjs +1 -1
  588. package/node_modules/@azure/msal-common/dist-browser/authority/AuthorityType.mjs +1 -1
  589. package/node_modules/@azure/msal-common/dist-browser/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
  590. package/node_modules/@azure/msal-common/dist-browser/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
  591. package/node_modules/@azure/msal-common/dist-browser/authority/OpenIdConfigResponse.mjs +1 -1
  592. package/node_modules/@azure/msal-common/dist-browser/authority/ProtocolMode.mjs +1 -1
  593. package/node_modules/@azure/msal-common/dist-browser/authority/RegionDiscovery.mjs +1 -1
  594. package/node_modules/@azure/msal-common/dist-browser/cache/CacheManager.mjs +3 -3
  595. package/node_modules/@azure/msal-common/dist-browser/cache/CacheManager.mjs.map +1 -1
  596. package/node_modules/@azure/msal-common/dist-browser/cache/persistence/TokenCacheContext.mjs +1 -1
  597. package/node_modules/@azure/msal-common/dist-browser/cache/utils/AccountEntityUtils.mjs +1 -1
  598. package/node_modules/@azure/msal-common/dist-browser/cache/utils/CacheHelpers.mjs +1 -1
  599. package/node_modules/@azure/msal-common/dist-browser/client/AuthorizationCodeClient.mjs +1 -1
  600. package/node_modules/@azure/msal-common/dist-browser/client/RefreshTokenClient.mjs +1 -1
  601. package/node_modules/@azure/msal-common/dist-browser/client/SilentFlowClient.mjs +1 -1
  602. package/node_modules/@azure/msal-common/dist-browser/config/ClientConfiguration.mjs +1 -1
  603. package/node_modules/@azure/msal-common/dist-browser/constants/AADServerParamKeys.mjs +1 -1
  604. package/node_modules/@azure/msal-common/dist-browser/crypto/ICrypto.mjs +1 -1
  605. package/node_modules/@azure/msal-common/dist-browser/crypto/JoseHeader.mjs +1 -1
  606. package/node_modules/@azure/msal-common/dist-browser/crypto/PopTokenGenerator.mjs +1 -1
  607. package/node_modules/@azure/msal-common/dist-browser/error/AuthError.mjs +1 -1
  608. package/node_modules/@azure/msal-common/dist-browser/error/AuthErrorCodes.mjs +1 -1
  609. package/node_modules/@azure/msal-common/dist-browser/error/CacheError.mjs +1 -1
  610. package/node_modules/@azure/msal-common/dist-browser/error/CacheErrorCodes.mjs +1 -1
  611. package/node_modules/@azure/msal-common/dist-browser/error/ClientAuthError.mjs +1 -1
  612. package/node_modules/@azure/msal-common/dist-browser/error/ClientAuthErrorCodes.mjs +1 -1
  613. package/node_modules/@azure/msal-common/dist-browser/error/ClientConfigurationError.mjs +1 -1
  614. package/node_modules/@azure/msal-common/dist-browser/error/ClientConfigurationErrorCodes.mjs +1 -1
  615. package/node_modules/@azure/msal-common/dist-browser/error/InteractionRequiredAuthError.mjs +4 -4
  616. package/node_modules/@azure/msal-common/dist-browser/error/InteractionRequiredAuthError.mjs.map +1 -1
  617. package/node_modules/@azure/msal-common/dist-browser/error/InteractionRequiredAuthErrorCodes.mjs +3 -3
  618. package/node_modules/@azure/msal-common/dist-browser/error/InteractionRequiredAuthErrorCodes.mjs.map +1 -1
  619. package/node_modules/@azure/msal-common/dist-browser/error/JoseHeaderError.mjs +1 -1
  620. package/node_modules/@azure/msal-common/dist-browser/error/JoseHeaderErrorCodes.mjs +1 -1
  621. package/node_modules/@azure/msal-common/dist-browser/error/NetworkError.mjs +1 -1
  622. package/node_modules/@azure/msal-common/dist-browser/error/PlatformBrokerError.mjs +1 -1
  623. package/node_modules/@azure/msal-common/dist-browser/error/ServerError.mjs +1 -1
  624. package/node_modules/@azure/msal-common/dist-browser/index-browser.mjs +1 -1
  625. package/node_modules/@azure/msal-common/dist-browser/index.mjs +1 -1
  626. package/node_modules/@azure/msal-common/dist-browser/log-strings-mapping.json +2 -2
  627. package/node_modules/@azure/msal-common/dist-browser/logger/Logger.mjs +1 -1
  628. package/node_modules/@azure/msal-common/dist-browser/network/INetworkModule.mjs +1 -1
  629. package/node_modules/@azure/msal-common/dist-browser/network/RequestThumbprint.mjs +1 -1
  630. package/node_modules/@azure/msal-common/dist-browser/network/ThrottlingUtils.mjs +1 -1
  631. package/node_modules/@azure/msal-common/dist-browser/packageMetadata.mjs +2 -2
  632. package/node_modules/@azure/msal-common/dist-browser/protocol/Authorize.mjs +1 -1
  633. package/node_modules/@azure/msal-common/dist-browser/protocol/Token.mjs +1 -1
  634. package/node_modules/@azure/msal-common/dist-browser/request/AuthenticationHeaderParser.mjs +1 -1
  635. package/node_modules/@azure/msal-common/dist-browser/request/BaseAuthRequest.mjs +1 -1
  636. package/node_modules/@azure/msal-common/dist-browser/request/RequestParameterBuilder.mjs +1 -1
  637. package/node_modules/@azure/msal-common/dist-browser/request/ScopeSet.mjs +1 -1
  638. package/node_modules/@azure/msal-common/dist-browser/response/ResponseHandler.mjs +1 -1
  639. package/node_modules/@azure/msal-common/dist-browser/telemetry/performance/PerformanceClient.mjs +1 -1
  640. package/node_modules/@azure/msal-common/dist-browser/telemetry/performance/PerformanceEvent.mjs +1 -1
  641. package/node_modules/@azure/msal-common/dist-browser/telemetry/performance/PerformanceEvents.mjs +1 -1
  642. package/node_modules/@azure/msal-common/dist-browser/telemetry/performance/StubPerformanceClient.mjs +1 -1
  643. package/node_modules/@azure/msal-common/dist-browser/telemetry/server/ServerTelemetryManager.mjs +1 -1
  644. package/node_modules/@azure/msal-common/dist-browser/url/UrlString.mjs +1 -1
  645. package/node_modules/@azure/msal-common/dist-browser/utils/ClientAssertionUtils.mjs +1 -1
  646. package/node_modules/@azure/msal-common/dist-browser/utils/Constants.mjs +1 -1
  647. package/node_modules/@azure/msal-common/dist-browser/utils/FunctionWrappers.mjs +1 -1
  648. package/node_modules/@azure/msal-common/dist-browser/utils/ProtocolUtils.mjs +1 -1
  649. package/node_modules/@azure/msal-common/dist-browser/utils/StringUtils.mjs +1 -1
  650. package/node_modules/@azure/msal-common/dist-browser/utils/TimeUtils.mjs +1 -1
  651. package/node_modules/@azure/msal-common/dist-browser/utils/UrlUtils.mjs +1 -1
  652. package/node_modules/@azure/msal-common/lib/index-browser.cjs +2 -2
  653. package/node_modules/@azure/msal-common/lib/{index-node-9_Gz5QUk.js → index-node-DHSwXao8.js} +27 -14
  654. package/node_modules/@azure/msal-common/lib/index-node-DHSwXao8.js.map +1 -0
  655. package/node_modules/@azure/msal-common/lib/index-node.cjs +2 -2
  656. package/node_modules/@azure/msal-common/lib/index.cjs +2 -2
  657. package/node_modules/@azure/msal-common/package.json +1 -1
  658. package/node_modules/@azure/msal-common/src/authority/Authority.ts +20 -5
  659. package/node_modules/@azure/msal-common/src/cache/CacheManager.ts +5 -10
  660. package/node_modules/@azure/msal-common/src/error/InteractionRequiredAuthError.ts +2 -2
  661. package/node_modules/@azure/msal-common/src/error/InteractionRequiredAuthErrorCodes.ts +1 -2
  662. package/node_modules/@azure/msal-common/src/packageMetadata.ts +1 -1
  663. package/node_modules/@azure/msal-common/types/authority/Authority.d.ts +5 -1
  664. package/node_modules/@azure/msal-common/types/authority/Authority.d.ts.map +1 -1
  665. package/node_modules/@azure/msal-common/types/cache/CacheManager.d.ts.map +1 -1
  666. package/node_modules/@azure/msal-common/types/error/InteractionRequiredAuthErrorCodes.d.ts +1 -1
  667. package/node_modules/@azure/msal-common/types/error/InteractionRequiredAuthErrorCodes.d.ts.map +1 -1
  668. package/node_modules/@azure/msal-common/types/packageMetadata.d.ts +1 -1
  669. package/node_modules/@azure/msal-node/dist/cache/CacheHelpers.mjs +1 -1
  670. package/node_modules/@azure/msal-node/dist/cache/NodeStorage.mjs +1 -1
  671. package/node_modules/@azure/msal-node/dist/cache/TokenCache.mjs +1 -1
  672. package/node_modules/@azure/msal-node/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  673. package/node_modules/@azure/msal-node/dist/cache/serializer/Deserializer.mjs +1 -1
  674. package/node_modules/@azure/msal-node/dist/cache/serializer/Serializer.mjs +1 -1
  675. package/node_modules/@azure/msal-node/dist/client/BaseClient.mjs +1 -1
  676. package/node_modules/@azure/msal-node/dist/client/ClientApplication.mjs +1 -1
  677. package/node_modules/@azure/msal-node/dist/client/ClientAssertion.mjs +1 -1
  678. package/node_modules/@azure/msal-node/dist/client/ClientCredentialClient.mjs +1 -1
  679. package/node_modules/@azure/msal-node/dist/client/ConfidentialClientApplication.mjs +1 -1
  680. package/node_modules/@azure/msal-node/dist/client/DeviceCodeClient.mjs +1 -1
  681. package/node_modules/@azure/msal-node/dist/client/ManagedIdentityApplication.mjs +1 -1
  682. package/node_modules/@azure/msal-node/dist/client/ManagedIdentityClient.mjs +1 -1
  683. package/node_modules/@azure/msal-node/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
  684. package/node_modules/@azure/msal-node/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
  685. package/node_modules/@azure/msal-node/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +1 -1
  686. package/node_modules/@azure/msal-node/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
  687. package/node_modules/@azure/msal-node/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
  688. package/node_modules/@azure/msal-node/dist/client/ManagedIdentitySources/MachineLearning.mjs +1 -1
  689. package/node_modules/@azure/msal-node/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
  690. package/node_modules/@azure/msal-node/dist/client/OnBehalfOfClient.mjs +1 -1
  691. package/node_modules/@azure/msal-node/dist/client/PublicClientApplication.mjs +1 -1
  692. package/node_modules/@azure/msal-node/dist/client/UsernamePasswordClient.mjs +1 -1
  693. package/node_modules/@azure/msal-node/dist/config/Configuration.mjs +1 -1
  694. package/node_modules/@azure/msal-node/dist/config/ManagedIdentityId.mjs +1 -1
  695. package/node_modules/@azure/msal-node/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
  696. package/node_modules/@azure/msal-node/dist/crypto/CryptoProvider.mjs +1 -1
  697. package/node_modules/@azure/msal-node/dist/crypto/GuidGenerator.mjs +1 -1
  698. package/node_modules/@azure/msal-node/dist/crypto/HashUtils.mjs +1 -1
  699. package/node_modules/@azure/msal-node/dist/crypto/PkceGenerator.mjs +1 -1
  700. package/node_modules/@azure/msal-node/dist/error/ClientAuthErrorCodes.mjs +1 -1
  701. package/node_modules/@azure/msal-node/dist/error/ManagedIdentityError.mjs +1 -1
  702. package/node_modules/@azure/msal-node/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  703. package/node_modules/@azure/msal-node/dist/error/NodeAuthError.mjs +1 -1
  704. package/node_modules/@azure/msal-node/dist/index.mjs +1 -1
  705. package/node_modules/@azure/msal-node/dist/internals.mjs +1 -1
  706. package/node_modules/@azure/msal-node/dist/network/HttpClient.mjs +1 -1
  707. package/node_modules/@azure/msal-node/dist/network/HttpClientWithRetries.mjs +1 -1
  708. package/node_modules/@azure/msal-node/dist/network/LoopbackClient.mjs +1 -1
  709. package/node_modules/@azure/msal-node/dist/packageMetadata.mjs +2 -2
  710. package/node_modules/@azure/msal-node/dist/protocol/Authorize.mjs +1 -1
  711. package/node_modules/@azure/msal-node/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
  712. package/node_modules/@azure/msal-node/dist/retry/ExponentialRetryStrategy.mjs +1 -1
  713. package/node_modules/@azure/msal-node/dist/retry/ImdsRetryPolicy.mjs +1 -1
  714. package/node_modules/@azure/msal-node/dist/retry/LinearRetryStrategy.mjs +1 -1
  715. package/node_modules/@azure/msal-node/dist/utils/Constants.mjs +1 -1
  716. package/node_modules/@azure/msal-node/dist/utils/EncodingUtils.mjs +1 -1
  717. package/node_modules/@azure/msal-node/dist/utils/TimeUtils.mjs +1 -1
  718. package/node_modules/@azure/msal-node/lib/msal-node.cjs +87 -74
  719. package/node_modules/@azure/msal-node/lib/msal-node.cjs.map +1 -1
  720. package/node_modules/@azure/msal-node/package.json +2 -2
  721. package/node_modules/@azure/msal-node/src/packageMetadata.ts +1 -1
  722. package/node_modules/@azure/msal-node/types/packageMetadata.d.ts +1 -1
  723. package/node_modules/@types/node/README.md +1 -1
  724. package/node_modules/@types/node/http2.d.ts +3 -0
  725. package/node_modules/@types/node/package.json +2 -2
  726. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/clientHelpers.js +1 -1
  727. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/clientHelpers.js.map +1 -1
  728. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/common.d.ts +3 -2
  729. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/common.js.map +1 -1
  730. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/getClient.js +1 -1
  731. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/getClient.js.map +1 -1
  732. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/multipart.js +1 -1
  733. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/multipart.js.map +1 -1
  734. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/restError.js +5 -4
  735. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/restError.js.map +1 -1
  736. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/sendRequest.js +13 -10
  737. package/node_modules/@typespec/ts-http-runtime/dist/browser/client/sendRequest.js.map +1 -1
  738. package/node_modules/@typespec/ts-http-runtime/dist/browser/constants.js +1 -1
  739. package/node_modules/@typespec/ts-http-runtime/dist/browser/constants.js.map +1 -1
  740. package/node_modules/@typespec/ts-http-runtime/dist/browser/createPipelineFromOptions.d.ts +1 -1
  741. package/node_modules/@typespec/ts-http-runtime/dist/browser/createPipelineFromOptions.js +2 -21
  742. package/node_modules/@typespec/ts-http-runtime/dist/browser/createPipelineFromOptions.js.map +1 -1
  743. package/node_modules/@typespec/ts-http-runtime/dist/browser/{defaultHttpClient.d.ts → defaultHttpClient-browser.d.mts} +1 -1
  744. package/node_modules/@typespec/ts-http-runtime/dist/browser/{defaultHttpClient.js → defaultHttpClient-browser.mjs} +1 -1
  745. package/node_modules/@typespec/ts-http-runtime/dist/browser/defaultHttpClient-browser.mjs.map +1 -0
  746. package/node_modules/@typespec/ts-http-runtime/dist/browser/encoding.d.ts +13 -0
  747. package/node_modules/@typespec/ts-http-runtime/dist/browser/encoding.js +19 -0
  748. package/node_modules/@typespec/ts-http-runtime/dist/browser/encoding.js.map +1 -0
  749. package/node_modules/@typespec/ts-http-runtime/dist/browser/{util/checkEnvironment.d.ts → env-browser.d.mts} +21 -1
  750. package/node_modules/@typespec/ts-http-runtime/dist/browser/{util/checkEnvironment.js → env-browser.mjs} +26 -12
  751. package/node_modules/@typespec/ts-http-runtime/dist/browser/env-browser.mjs.map +1 -0
  752. package/node_modules/@typespec/ts-http-runtime/dist/browser/formData-web.d.mts +9 -0
  753. package/node_modules/@typespec/ts-http-runtime/dist/browser/formData-web.mjs +12 -0
  754. package/node_modules/@typespec/ts-http-runtime/dist/browser/formData-web.mjs.map +1 -0
  755. package/node_modules/@typespec/ts-http-runtime/dist/browser/httpHeaders.js +11 -1
  756. package/node_modules/@typespec/ts-http-runtime/dist/browser/httpHeaders.js.map +1 -1
  757. package/node_modules/@typespec/ts-http-runtime/dist/browser/index.d.ts +3 -14
  758. package/node_modules/@typespec/ts-http-runtime/dist/browser/index.js +2 -2
  759. package/node_modules/@typespec/ts-http-runtime/dist/browser/index.js.map +1 -1
  760. package/node_modules/@typespec/ts-http-runtime/dist/browser/interfaces.d.ts +15 -14
  761. package/node_modules/@typespec/ts-http-runtime/dist/browser/interfaces.js.map +1 -1
  762. package/node_modules/@typespec/ts-http-runtime/dist/browser/logger/debug.js +3 -2
  763. package/node_modules/@typespec/ts-http-runtime/dist/browser/logger/debug.js.map +1 -1
  764. package/node_modules/@typespec/ts-http-runtime/dist/browser/logger/{log.d.ts → log-web.d.mts} +1 -1
  765. package/node_modules/@typespec/ts-http-runtime/dist/browser/logger/{log.js → log-web.mjs} +1 -1
  766. package/node_modules/@typespec/ts-http-runtime/dist/browser/logger/log-web.mjs.map +1 -0
  767. package/node_modules/@typespec/ts-http-runtime/dist/browser/logger/logger.js +2 -2
  768. package/node_modules/@typespec/ts-http-runtime/dist/browser/logger/logger.js.map +1 -1
  769. package/node_modules/@typespec/ts-http-runtime/dist/browser/pipelineRequest.js +1 -1
  770. package/node_modules/@typespec/ts-http-runtime/dist/browser/pipelineRequest.js.map +1 -1
  771. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/auth/basicAuthenticationPolicy.js +1 -1
  772. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/auth/basicAuthenticationPolicy.js.map +1 -1
  773. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/auth/checkInsecureConnection.js +3 -2
  774. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/auth/checkInsecureConnection.js.map +1 -1
  775. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/{decompressResponsePolicy.d.ts → decompressResponsePolicy-web.d.mts} +1 -1
  776. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/{decompressResponsePolicy.js → decompressResponsePolicy-web.mjs} +1 -1
  777. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/decompressResponsePolicy-web.mjs.map +1 -0
  778. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/formDataPolicy.js +5 -12
  779. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/formDataPolicy.js.map +1 -1
  780. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/internal.d.ts +2 -2
  781. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/internal.js +2 -2
  782. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/internal.js.map +1 -1
  783. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/multipartPolicy.js +7 -3
  784. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/multipartPolicy.js.map +1 -1
  785. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/platformPolicies-web.d.mts +10 -0
  786. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/platformPolicies-web.mjs +12 -0
  787. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/platformPolicies-web.mjs.map +1 -0
  788. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/platformPolicies.d.ts +25 -0
  789. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/platformPolicies.js +30 -0
  790. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/platformPolicies.js.map +1 -0
  791. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/proxyPolicy-web.d.mts +2 -0
  792. package/node_modules/@typespec/ts-http-runtime/dist/{react-native/policies/proxyPolicy.js → browser/policies/proxyPolicy-web.mjs} +1 -1
  793. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/proxyPolicy-web.mjs.map +1 -0
  794. package/node_modules/@typespec/ts-http-runtime/dist/browser/restError.js +1 -1
  795. package/node_modules/@typespec/ts-http-runtime/dist/browser/restError.js.map +1 -1
  796. package/node_modules/@typespec/ts-http-runtime/dist/browser/types-browser.d.mts +19 -0
  797. package/node_modules/@typespec/ts-http-runtime/dist/browser/types-browser.mjs +4 -0
  798. package/node_modules/@typespec/ts-http-runtime/dist/browser/types-browser.mjs.map +1 -0
  799. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/bytesEncoding-web.d.mts +2 -0
  800. package/node_modules/@typespec/ts-http-runtime/dist/{react-native/util/bytesEncoding.js → browser/util/bytesEncoding-web.mjs} +1 -1
  801. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/bytesEncoding-web.mjs.map +1 -0
  802. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/bytesEncoding.common.d.ts +4 -4
  803. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/bytesEncoding.common.js +3 -4
  804. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/bytesEncoding.common.js.map +1 -1
  805. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/concat-browser.d.mts +16 -0
  806. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/{concat.js → concat-browser.mjs} +4 -11
  807. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/concat-browser.mjs.map +1 -0
  808. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/inspect-web.d.mts +2 -0
  809. package/node_modules/@typespec/ts-http-runtime/dist/{react-native/util/inspect.js → browser/util/inspect-web.mjs} +1 -1
  810. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/inspect-web.mjs.map +1 -0
  811. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/internal.d.ts +4 -4
  812. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/internal.js +4 -4
  813. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/internal.js.map +1 -1
  814. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/sha256-web.d.mts +2 -0
  815. package/node_modules/@typespec/ts-http-runtime/dist/{react-native/util/sha256.js → browser/util/sha256-web.mjs} +1 -1
  816. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/sha256-web.mjs.map +1 -0
  817. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/sha256.common.js +1 -1
  818. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/sha256.common.js.map +1 -1
  819. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/typeGuards-browser.d.mts +14 -0
  820. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/typeGuards-browser.mjs +26 -0
  821. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/typeGuards-browser.mjs.map +1 -0
  822. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/typeGuards.d.ts +5 -4
  823. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/typeGuards.js +4 -10
  824. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/typeGuards.js.map +1 -1
  825. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/userAgent.d.ts +2 -0
  826. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/userAgent.js +2 -1
  827. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/userAgent.js.map +1 -1
  828. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/userAgentPlatform-browser.d.mts +37 -0
  829. package/node_modules/{@azure/core-rest-pipeline/dist/browser/util/userAgentPlatform.js → @typespec/ts-http-runtime/dist/browser/util/userAgentPlatform-browser.mjs} +10 -11
  830. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/userAgentPlatform-browser.mjs.map +1 -0
  831. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/{uuidUtils.d.ts → uuidUtils-browser.d.mts} +1 -1
  832. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/{uuidUtils.js → uuidUtils-browser.mjs} +1 -1
  833. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/uuidUtils-browser.mjs.map +1 -0
  834. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/client/clientHelpers.js +2 -2
  835. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/client/clientHelpers.js.map +2 -2
  836. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/client/common.d.ts +3 -2
  837. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/client/common.js.map +1 -1
  838. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/client/getClient.js +3 -3
  839. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/client/getClient.js.map +2 -2
  840. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js.map +1 -1
  841. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/client/restError.js +5 -4
  842. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/client/restError.js.map +2 -2
  843. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/client/sendRequest.js +26 -8
  844. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/client/sendRequest.js.map +2 -2
  845. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/constants.js +1 -1
  846. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/constants.js.map +1 -1
  847. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/createPipelineFromOptions.d.ts +1 -1
  848. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/createPipelineFromOptions.js +2 -19
  849. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/createPipelineFromOptions.js.map +2 -2
  850. package/node_modules/@typespec/ts-http-runtime/dist/{react-native/util/checkEnvironment.d.ts → commonjs/env.d.ts} +21 -1
  851. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/env.js +67 -0
  852. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/env.js.map +7 -0
  853. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/formData.d.ts +10 -0
  854. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/{util/arrayBuffer.js → formData.js} +19 -14
  855. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/formData.js.map +7 -0
  856. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/httpHeaders.js +4 -1
  857. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/httpHeaders.js.map +2 -2
  858. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/index.d.ts +1 -12
  859. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/index.js +2 -2
  860. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/index.js.map +2 -2
  861. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/interfaces.d.ts +15 -14
  862. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/interfaces.js.map +1 -1
  863. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/debug.js +2 -1
  864. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/debug.js.map +2 -2
  865. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/logger.js +2 -1
  866. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/logger.js.map +2 -2
  867. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/nodeHttpClient.js +3 -1
  868. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/nodeHttpClient.js.map +2 -2
  869. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/pipelineRequest.js +2 -2
  870. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/pipelineRequest.js.map +2 -2
  871. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/basicAuthenticationPolicy.js.map +1 -1
  872. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/checkInsecureConnection.js +3 -2
  873. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/checkInsecureConnection.js.map +2 -2
  874. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/formDataPolicy.js +4 -11
  875. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/formDataPolicy.js.map +2 -2
  876. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/internal.d.ts +1 -1
  877. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/internal.js +7 -7
  878. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/internal.js.map +2 -2
  879. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/multipartPolicy.js +2 -2
  880. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/multipartPolicy.js.map +2 -2
  881. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/platformPolicies.d.ts +25 -0
  882. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/platformPolicies.js +43 -0
  883. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/platformPolicies.js.map +7 -0
  884. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/restError.js.map +1 -1
  885. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/tsdoc-metadata.json +1 -1
  886. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/types.d.ts +19 -0
  887. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/types.js +16 -0
  888. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/types.js.map +7 -0
  889. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/concat.d.ts +1 -1
  890. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/concat.js.map +2 -2
  891. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/internal.d.ts +1 -1
  892. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/internal.js +10 -10
  893. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/internal.js.map +2 -2
  894. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/typeGuards-node.d.ts +13 -0
  895. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/{logger/log.common.js → util/typeGuards-node.js} +14 -21
  896. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/typeGuards-node.js.map +7 -0
  897. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/typeGuards.d.ts +5 -4
  898. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/typeGuards.js +6 -13
  899. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/typeGuards.js.map +2 -2
  900. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/userAgent.d.ts +2 -0
  901. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/userAgent.js +7 -5
  902. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/userAgent.js.map +2 -2
  903. package/node_modules/@typespec/ts-http-runtime/dist/esm/client/clientHelpers.js.map +1 -1
  904. package/node_modules/@typespec/ts-http-runtime/dist/esm/client/common.d.ts +3 -2
  905. package/node_modules/@typespec/ts-http-runtime/dist/esm/client/common.js.map +1 -1
  906. package/node_modules/@typespec/ts-http-runtime/dist/esm/client/getClient.js +1 -1
  907. package/node_modules/@typespec/ts-http-runtime/dist/esm/client/getClient.js.map +1 -1
  908. package/node_modules/@typespec/ts-http-runtime/dist/esm/client/multipart.js.map +1 -1
  909. package/node_modules/@typespec/ts-http-runtime/dist/esm/client/restError.js +5 -4
  910. package/node_modules/@typespec/ts-http-runtime/dist/esm/client/restError.js.map +1 -1
  911. package/node_modules/@typespec/ts-http-runtime/dist/esm/client/sendRequest.js +13 -10
  912. package/node_modules/@typespec/ts-http-runtime/dist/esm/client/sendRequest.js.map +1 -1
  913. package/node_modules/@typespec/ts-http-runtime/dist/esm/constants.js +1 -1
  914. package/node_modules/@typespec/ts-http-runtime/dist/esm/constants.js.map +1 -1
  915. package/node_modules/@typespec/ts-http-runtime/dist/esm/createPipelineFromOptions.d.ts +1 -1
  916. package/node_modules/@typespec/ts-http-runtime/dist/esm/createPipelineFromOptions.js +2 -21
  917. package/node_modules/@typespec/ts-http-runtime/dist/esm/createPipelineFromOptions.js.map +1 -1
  918. package/node_modules/@typespec/ts-http-runtime/dist/{commonjs/util/checkEnvironment.d.ts → esm/env.d.ts} +21 -1
  919. package/node_modules/@typespec/ts-http-runtime/dist/esm/env.js +48 -0
  920. package/node_modules/@typespec/ts-http-runtime/dist/esm/env.js.map +1 -0
  921. package/node_modules/@typespec/ts-http-runtime/dist/esm/formData.d.ts +10 -0
  922. package/node_modules/@typespec/ts-http-runtime/dist/esm/formData.js +26 -0
  923. package/node_modules/@typespec/ts-http-runtime/dist/esm/formData.js.map +1 -0
  924. package/node_modules/@typespec/ts-http-runtime/dist/esm/httpHeaders.js +11 -1
  925. package/node_modules/@typespec/ts-http-runtime/dist/esm/httpHeaders.js.map +1 -1
  926. package/node_modules/@typespec/ts-http-runtime/dist/esm/index.d.ts +1 -12
  927. package/node_modules/@typespec/ts-http-runtime/dist/esm/index.js.map +1 -1
  928. package/node_modules/@typespec/ts-http-runtime/dist/esm/interfaces.d.ts +15 -14
  929. package/node_modules/@typespec/ts-http-runtime/dist/esm/interfaces.js.map +1 -1
  930. package/node_modules/@typespec/ts-http-runtime/dist/esm/logger/debug.js +2 -1
  931. package/node_modules/@typespec/ts-http-runtime/dist/esm/logger/debug.js.map +1 -1
  932. package/node_modules/@typespec/ts-http-runtime/dist/esm/logger/logger.js +2 -2
  933. package/node_modules/@typespec/ts-http-runtime/dist/esm/logger/logger.js.map +1 -1
  934. package/node_modules/@typespec/ts-http-runtime/dist/esm/nodeHttpClient.js +3 -1
  935. package/node_modules/@typespec/ts-http-runtime/dist/esm/nodeHttpClient.js.map +1 -1
  936. package/node_modules/@typespec/ts-http-runtime/dist/esm/pipelineRequest.js.map +1 -1
  937. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/auth/basicAuthenticationPolicy.js.map +1 -1
  938. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/auth/checkInsecureConnection.js +3 -2
  939. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/auth/checkInsecureConnection.js.map +1 -1
  940. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/formDataPolicy.js +4 -11
  941. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/formDataPolicy.js.map +1 -1
  942. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/internal.d.ts +1 -1
  943. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/internal.js +1 -1
  944. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/internal.js.map +1 -1
  945. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/multipartPolicy.js +4 -0
  946. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/multipartPolicy.js.map +1 -1
  947. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/platformPolicies.d.ts +25 -0
  948. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/platformPolicies.js +30 -0
  949. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/platformPolicies.js.map +1 -0
  950. package/node_modules/@typespec/ts-http-runtime/dist/esm/restError.js.map +1 -1
  951. package/node_modules/@typespec/ts-http-runtime/dist/esm/types.d.ts +19 -0
  952. package/node_modules/@typespec/ts-http-runtime/dist/esm/types.js +4 -0
  953. package/node_modules/@typespec/ts-http-runtime/dist/esm/types.js.map +1 -0
  954. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/concat.d.ts +1 -1
  955. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/concat.js.map +1 -1
  956. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/internal.d.ts +1 -1
  957. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/internal.js +1 -1
  958. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/internal.js.map +1 -1
  959. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/typeGuards-node.d.ts +13 -0
  960. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/typeGuards-node.js +20 -0
  961. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/typeGuards-node.js.map +1 -0
  962. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/typeGuards.d.ts +5 -4
  963. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/typeGuards.js +4 -10
  964. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/typeGuards.js.map +1 -1
  965. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/userAgent.d.ts +2 -0
  966. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/userAgent.js +1 -0
  967. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/userAgent.js.map +1 -1
  968. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/clientHelpers.js +1 -1
  969. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/clientHelpers.js.map +1 -1
  970. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/common.d.ts +3 -2
  971. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/common.js.map +1 -1
  972. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/getClient.js +1 -1
  973. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/getClient.js.map +1 -1
  974. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/multipart.js +1 -1
  975. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/multipart.js.map +1 -1
  976. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/restError.js +5 -4
  977. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/restError.js.map +1 -1
  978. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/sendRequest.js +13 -10
  979. package/node_modules/@typespec/ts-http-runtime/dist/react-native/client/sendRequest.js.map +1 -1
  980. package/node_modules/@typespec/ts-http-runtime/dist/react-native/constants.js +1 -1
  981. package/node_modules/@typespec/ts-http-runtime/dist/react-native/constants.js.map +1 -1
  982. package/node_modules/@typespec/ts-http-runtime/dist/react-native/createPipelineFromOptions.d.ts +1 -1
  983. package/node_modules/@typespec/ts-http-runtime/dist/react-native/createPipelineFromOptions.js +2 -21
  984. package/node_modules/@typespec/ts-http-runtime/dist/react-native/createPipelineFromOptions.js.map +1 -1
  985. package/node_modules/@typespec/ts-http-runtime/dist/react-native/{defaultHttpClient.d.ts → defaultHttpClient-react-native.d.mts} +1 -1
  986. package/node_modules/@typespec/ts-http-runtime/dist/react-native/{defaultHttpClient.js → defaultHttpClient-react-native.mjs} +1 -1
  987. package/node_modules/@typespec/ts-http-runtime/dist/react-native/defaultHttpClient-react-native.mjs.map +1 -0
  988. package/node_modules/@typespec/ts-http-runtime/dist/react-native/encoding-react-native.d.mts +21 -0
  989. package/node_modules/@typespec/ts-http-runtime/dist/react-native/encoding-react-native.mjs +25 -0
  990. package/node_modules/@typespec/ts-http-runtime/dist/react-native/encoding-react-native.mjs.map +1 -0
  991. package/node_modules/@typespec/ts-http-runtime/dist/{esm/util/checkEnvironment.d.ts → react-native/env-react-native.d.mts} +21 -1
  992. package/node_modules/@typespec/ts-http-runtime/dist/react-native/env-react-native.mjs +50 -0
  993. package/node_modules/@typespec/ts-http-runtime/dist/react-native/env-react-native.mjs.map +1 -0
  994. package/node_modules/@typespec/ts-http-runtime/dist/react-native/formData-web.d.mts +9 -0
  995. package/node_modules/@typespec/ts-http-runtime/dist/react-native/formData-web.mjs +12 -0
  996. package/node_modules/@typespec/ts-http-runtime/dist/react-native/formData-web.mjs.map +1 -0
  997. package/node_modules/@typespec/ts-http-runtime/dist/react-native/httpHeaders.js +11 -1
  998. package/node_modules/@typespec/ts-http-runtime/dist/react-native/httpHeaders.js.map +1 -1
  999. package/node_modules/@typespec/ts-http-runtime/dist/react-native/index.d.ts +3 -14
  1000. package/node_modules/@typespec/ts-http-runtime/dist/react-native/index.js +2 -2
  1001. package/node_modules/@typespec/ts-http-runtime/dist/react-native/index.js.map +1 -1
  1002. package/node_modules/@typespec/ts-http-runtime/dist/react-native/interfaces.d.ts +15 -14
  1003. package/node_modules/@typespec/ts-http-runtime/dist/react-native/interfaces.js.map +1 -1
  1004. package/node_modules/@typespec/ts-http-runtime/dist/react-native/logger/debug.js +3 -2
  1005. package/node_modules/@typespec/ts-http-runtime/dist/react-native/logger/debug.js.map +1 -1
  1006. package/node_modules/@typespec/ts-http-runtime/dist/react-native/logger/{log.d.ts → log-web.d.mts} +1 -1
  1007. package/node_modules/@typespec/ts-http-runtime/dist/react-native/logger/{log.js → log-web.mjs} +1 -1
  1008. package/node_modules/@typespec/ts-http-runtime/dist/react-native/logger/log-web.mjs.map +1 -0
  1009. package/node_modules/@typespec/ts-http-runtime/dist/react-native/logger/logger.js +2 -2
  1010. package/node_modules/@typespec/ts-http-runtime/dist/react-native/logger/logger.js.map +1 -1
  1011. package/node_modules/@typespec/ts-http-runtime/dist/react-native/pipelineRequest.js +1 -1
  1012. package/node_modules/@typespec/ts-http-runtime/dist/react-native/pipelineRequest.js.map +1 -1
  1013. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/auth/basicAuthenticationPolicy.js +1 -1
  1014. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/auth/basicAuthenticationPolicy.js.map +1 -1
  1015. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/auth/checkInsecureConnection.js +3 -2
  1016. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/auth/checkInsecureConnection.js.map +1 -1
  1017. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/decompressResponsePolicy-web.d.mts +8 -0
  1018. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/decompressResponsePolicy-web.mjs +11 -0
  1019. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/decompressResponsePolicy-web.mjs.map +1 -0
  1020. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/formDataPolicy.js +5 -12
  1021. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/formDataPolicy.js.map +1 -1
  1022. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/internal.d.ts +2 -2
  1023. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/internal.js +2 -2
  1024. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/internal.js.map +1 -1
  1025. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/multipartPolicy.js +7 -3
  1026. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/multipartPolicy.js.map +1 -1
  1027. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/platformPolicies-web.d.mts +10 -0
  1028. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/platformPolicies-web.mjs +12 -0
  1029. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/platformPolicies-web.mjs.map +1 -0
  1030. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/platformPolicies.d.ts +25 -0
  1031. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/platformPolicies.js +30 -0
  1032. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/platformPolicies.js.map +1 -0
  1033. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/proxyPolicy-web.d.mts +2 -0
  1034. package/node_modules/@typespec/ts-http-runtime/dist/{browser/policies/proxyPolicy.js → react-native/policies/proxyPolicy-web.mjs} +1 -1
  1035. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/proxyPolicy-web.mjs.map +1 -0
  1036. package/node_modules/@typespec/ts-http-runtime/dist/react-native/restError.js +1 -1
  1037. package/node_modules/@typespec/ts-http-runtime/dist/react-native/restError.js.map +1 -1
  1038. package/node_modules/@typespec/ts-http-runtime/dist/react-native/types-react-native.d.mts +19 -0
  1039. package/node_modules/@typespec/ts-http-runtime/dist/react-native/types-react-native.mjs +4 -0
  1040. package/node_modules/@typespec/ts-http-runtime/dist/react-native/types-react-native.mjs.map +1 -0
  1041. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/bytesEncoding-web.d.mts +2 -0
  1042. package/node_modules/@typespec/ts-http-runtime/dist/{browser/util/bytesEncoding.js → react-native/util/bytesEncoding-web.mjs} +1 -1
  1043. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/bytesEncoding-web.mjs.map +1 -0
  1044. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/bytesEncoding.common.d.ts +4 -4
  1045. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/bytesEncoding.common.js +3 -4
  1046. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/bytesEncoding.common.js.map +1 -1
  1047. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/{concat.d.ts → concat-react-native.d.mts} +10 -3
  1048. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/{concat.js → concat-react-native.mjs} +2 -2
  1049. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/concat-react-native.mjs.map +1 -0
  1050. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/inspect-web.d.mts +2 -0
  1051. package/node_modules/@typespec/ts-http-runtime/dist/{browser/util/inspect.js → react-native/util/inspect-web.mjs} +1 -1
  1052. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/inspect-web.mjs.map +1 -0
  1053. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/internal.d.ts +4 -4
  1054. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/internal.js +4 -4
  1055. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/internal.js.map +1 -1
  1056. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/sha256-web.d.mts +2 -0
  1057. package/node_modules/@typespec/ts-http-runtime/dist/{browser/util/sha256.js → react-native/util/sha256-web.mjs} +1 -1
  1058. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/sha256-web.mjs.map +1 -0
  1059. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/sha256.common.js +1 -1
  1060. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/sha256.common.js.map +1 -1
  1061. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/typeGuards-react-native.d.mts +16 -0
  1062. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/typeGuards-react-native.mjs +34 -0
  1063. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/typeGuards-react-native.mjs.map +1 -0
  1064. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/typeGuards.d.ts +5 -4
  1065. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/typeGuards.js +4 -10
  1066. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/typeGuards.js.map +1 -1
  1067. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/userAgent.d.ts +2 -0
  1068. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/userAgent.js +2 -1
  1069. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/userAgent.js.map +1 -1
  1070. package/node_modules/{@azure/core-rest-pipeline/dist/react-native/util/userAgentPlatform.d.ts → @typespec/ts-http-runtime/dist/react-native/util/userAgentPlatform-react-native.d.mts} +1 -1
  1071. package/node_modules/{@azure/core-rest-pipeline/dist/react-native/util/userAgentPlatform.js → @typespec/ts-http-runtime/dist/react-native/util/userAgentPlatform-react-native.mjs} +1 -1
  1072. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/userAgentPlatform-react-native.mjs.map +1 -0
  1073. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/uuidUtils-react-native.d.mts +2 -0
  1074. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/{uuidUtils.js → uuidUtils-react-native.mjs} +1 -1
  1075. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/uuidUtils-react-native.mjs.map +1 -0
  1076. package/node_modules/@typespec/ts-http-runtime/package.json +94 -8
  1077. package/node_modules/semver/classes/semver.js +19 -2
  1078. package/node_modules/semver/package.json +1 -1
  1079. package/npm-shrinkwrap.json +29 -29
  1080. package/package.json +4 -4
  1081. package/dist/contract-api.js +0 -2
  1082. package/dist/secret-contract-CSs7JYzG.js +0 -35
  1083. package/node_modules/@azure/core-client/dist/browser/base64-browser.mjs.map +0 -1
  1084. package/node_modules/@azure/core-client/dist/browser/state-browser.mjs.map +0 -1
  1085. package/node_modules/@azure/core-client/dist/commonjs/state-cjs.cjs.map +0 -1
  1086. package/node_modules/@azure/core-client/dist/commonjs/state.d.ts +0 -7
  1087. package/node_modules/@azure/core-client/dist/react-native/state.d.ts +0 -8
  1088. package/node_modules/@azure/core-client/dist/react-native/state.js +0 -10
  1089. package/node_modules/@azure/core-client/dist/react-native/state.js.map +0 -1
  1090. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/userAgentPlatform.d.ts +0 -9
  1091. package/node_modules/@azure/core-rest-pipeline/dist/browser/util/userAgentPlatform.js.map +0 -1
  1092. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/userAgentPlatform.js.map +0 -1
  1093. package/node_modules/@azure/core-rest-pipeline/dist/react-native/util/wrapAbortSignal.js.map +0 -1
  1094. package/node_modules/@azure/msal-common/lib/index-node-9_Gz5QUk.js.map +0 -1
  1095. package/node_modules/@typespec/ts-http-runtime/dist/browser/defaultHttpClient.js.map +0 -1
  1096. package/node_modules/@typespec/ts-http-runtime/dist/browser/logger/log.js.map +0 -1
  1097. package/node_modules/@typespec/ts-http-runtime/dist/browser/nodeHttpClient.d.ts +0 -9
  1098. package/node_modules/@typespec/ts-http-runtime/dist/browser/nodeHttpClient.js +0 -347
  1099. package/node_modules/@typespec/ts-http-runtime/dist/browser/nodeHttpClient.js.map +0 -1
  1100. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/decompressResponsePolicy.js.map +0 -1
  1101. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/proxyPolicy.d.ts +0 -2
  1102. package/node_modules/@typespec/ts-http-runtime/dist/browser/policies/proxyPolicy.js.map +0 -1
  1103. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/bytesEncoding.d.ts +0 -2
  1104. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/bytesEncoding.js.map +0 -1
  1105. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/checkEnvironment.js.map +0 -1
  1106. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/concat.d.ts +0 -17
  1107. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/concat.js.map +0 -1
  1108. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/inspect.d.ts +0 -2
  1109. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/inspect.js.map +0 -1
  1110. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/sha256.d.ts +0 -2
  1111. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/sha256.js.map +0 -1
  1112. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/userAgentPlatform.js.map +0 -1
  1113. package/node_modules/@typespec/ts-http-runtime/dist/browser/util/uuidUtils.js.map +0 -1
  1114. package/node_modules/@typespec/ts-http-runtime/dist/browser/xhrHttpClient.d.ts +0 -7
  1115. package/node_modules/@typespec/ts-http-runtime/dist/browser/xhrHttpClient.js +0 -174
  1116. package/node_modules/@typespec/ts-http-runtime/dist/browser/xhrHttpClient.js.map +0 -1
  1117. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/fetchHttpClient.d.ts +0 -12
  1118. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/fetchHttpClient.js +0 -238
  1119. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/fetchHttpClient.js.map +0 -7
  1120. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/log.common.d.ts +0 -2
  1121. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/log.common.js.map +0 -7
  1122. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/proxyPolicy.common.d.ts +0 -19
  1123. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/proxyPolicy.common.js +0 -44
  1124. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/proxyPolicy.common.js.map +0 -7
  1125. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/arrayBuffer.d.ts +0 -7
  1126. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/arrayBuffer.js.map +0 -7
  1127. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/bytesEncoding.common.d.ts +0 -61
  1128. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/bytesEncoding.common.js +0 -106
  1129. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/bytesEncoding.common.js.map +0 -7
  1130. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/checkEnvironment.js +0 -46
  1131. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/checkEnvironment.js.map +0 -7
  1132. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.common.d.ts +0 -2
  1133. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.common.js.map +0 -7
  1134. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sha256.common.d.ts +0 -14
  1135. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sha256.common.js +0 -70
  1136. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sha256.common.js.map +0 -7
  1137. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/uuidUtils.common.d.ts +0 -13
  1138. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/uuidUtils.common.js +0 -49
  1139. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/util/uuidUtils.common.js.map +0 -7
  1140. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/xhrHttpClient.d.ts +0 -7
  1141. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/xhrHttpClient.js +0 -186
  1142. package/node_modules/@typespec/ts-http-runtime/dist/commonjs/xhrHttpClient.js.map +0 -7
  1143. package/node_modules/@typespec/ts-http-runtime/dist/esm/fetchHttpClient.d.ts +0 -12
  1144. package/node_modules/@typespec/ts-http-runtime/dist/esm/fetchHttpClient.js +0 -279
  1145. package/node_modules/@typespec/ts-http-runtime/dist/esm/fetchHttpClient.js.map +0 -1
  1146. package/node_modules/@typespec/ts-http-runtime/dist/esm/logger/log.common.d.ts +0 -2
  1147. package/node_modules/@typespec/ts-http-runtime/dist/esm/logger/log.common.js +0 -23
  1148. package/node_modules/@typespec/ts-http-runtime/dist/esm/logger/log.common.js.map +0 -1
  1149. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/proxyPolicy.common.d.ts +0 -19
  1150. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/proxyPolicy.common.js +0 -24
  1151. package/node_modules/@typespec/ts-http-runtime/dist/esm/policies/proxyPolicy.common.js.map +0 -1
  1152. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/arrayBuffer.d.ts +0 -7
  1153. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/arrayBuffer.js +0 -20
  1154. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/arrayBuffer.js.map +0 -1
  1155. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/bytesEncoding.common.d.ts +0 -61
  1156. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/bytesEncoding.common.js +0 -110
  1157. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/bytesEncoding.common.js.map +0 -1
  1158. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/checkEnvironment.js +0 -41
  1159. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/checkEnvironment.js.map +0 -1
  1160. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/inspect.common.d.ts +0 -2
  1161. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/inspect.common.js +0 -4
  1162. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/inspect.common.js.map +0 -1
  1163. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/sha256.common.d.ts +0 -14
  1164. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/sha256.common.js +0 -49
  1165. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/sha256.common.js.map +0 -1
  1166. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/uuidUtils.common.d.ts +0 -13
  1167. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/uuidUtils.common.js +0 -40
  1168. package/node_modules/@typespec/ts-http-runtime/dist/esm/util/uuidUtils.common.js.map +0 -1
  1169. package/node_modules/@typespec/ts-http-runtime/dist/esm/xhrHttpClient.d.ts +0 -7
  1170. package/node_modules/@typespec/ts-http-runtime/dist/esm/xhrHttpClient.js +0 -174
  1171. package/node_modules/@typespec/ts-http-runtime/dist/esm/xhrHttpClient.js.map +0 -1
  1172. package/node_modules/@typespec/ts-http-runtime/dist/react-native/defaultHttpClient.js.map +0 -1
  1173. package/node_modules/@typespec/ts-http-runtime/dist/react-native/fetchHttpClient.d.ts +0 -12
  1174. package/node_modules/@typespec/ts-http-runtime/dist/react-native/fetchHttpClient.js +0 -279
  1175. package/node_modules/@typespec/ts-http-runtime/dist/react-native/fetchHttpClient.js.map +0 -1
  1176. package/node_modules/@typespec/ts-http-runtime/dist/react-native/logger/log.js.map +0 -1
  1177. package/node_modules/@typespec/ts-http-runtime/dist/react-native/nodeHttpClient.d.ts +0 -9
  1178. package/node_modules/@typespec/ts-http-runtime/dist/react-native/nodeHttpClient.js +0 -347
  1179. package/node_modules/@typespec/ts-http-runtime/dist/react-native/nodeHttpClient.js.map +0 -1
  1180. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/decompressResponsePolicy.d.ts +0 -11
  1181. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/decompressResponsePolicy.js +0 -23
  1182. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/decompressResponsePolicy.js.map +0 -1
  1183. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/proxyPolicy.d.ts +0 -2
  1184. package/node_modules/@typespec/ts-http-runtime/dist/react-native/policies/proxyPolicy.js.map +0 -1
  1185. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/bytesEncoding.d.ts +0 -2
  1186. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/bytesEncoding.js.map +0 -1
  1187. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/checkEnvironment.js +0 -41
  1188. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/checkEnvironment.js.map +0 -1
  1189. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/concat.js.map +0 -1
  1190. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/inspect.d.ts +0 -2
  1191. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/inspect.js.map +0 -1
  1192. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/sha256.d.ts +0 -2
  1193. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/sha256.js.map +0 -1
  1194. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/userAgentPlatform.js.map +0 -1
  1195. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/uuidUtils.d.ts +0 -2
  1196. package/node_modules/@typespec/ts-http-runtime/dist/react-native/util/uuidUtils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AuthScheme } from \"./auth/schemes.js\";\n\n/**\n * A HttpHeaders collection represented as a simple JSON object.\n */\nexport type RawHttpHeaders = { [headerName: string]: string };\n\n/**\n * A HttpHeaders collection for input, represented as a simple JSON object.\n */\nexport type RawHttpHeadersInput = Record<string, string | number | boolean>;\n\n/**\n * Represents a set of HTTP headers on a request/response.\n * Header names are treated as case insensitive.\n */\nexport interface HttpHeaders extends Iterable<[string, string]> {\n /**\n * Returns the value of a specific header or undefined if not set.\n * @param name - The name of the header to retrieve.\n */\n get(name: string): string | undefined;\n /**\n * Returns true if the specified header exists.\n * @param name - The name of the header to check.\n */\n has(name: string): boolean;\n /**\n * Sets a specific header with a given value.\n * @param name - The name of the header to set.\n * @param value - The value to use for the header.\n */\n set(name: string, value: string | number | boolean): void;\n /**\n * Removes a specific header from the collection.\n * @param name - The name of the header to delete.\n */\n delete(name: string): void;\n /**\n * Accesses a raw JS object that acts as a simple map\n * of header names to values.\n */\n toJSON(options?: { preserveCase?: boolean }): RawHttpHeaders;\n}\n\n/**\n * A part of the request body in a multipart request.\n */\nexport interface BodyPart {\n /**\n * The headers for this part of the multipart request.\n */\n headers: HttpHeaders;\n\n /**\n * The body of this part of the multipart request.\n */\n body:\n | ((() => ReadableStream<Uint8Array>) | (() => NodeJS.ReadableStream))\n | ReadableStream<Uint8Array>\n | NodeJS.ReadableStream\n | Uint8Array\n | Blob;\n}\n\n/**\n * A request body consisting of multiple parts.\n */\nexport interface MultipartRequestBody {\n /**\n * The parts of the request body.\n */\n parts: BodyPart[];\n\n /**\n * The boundary separating each part of the request body.\n * If not specified, a random boundary will be generated.\n *\n * When specified, '--' will be prepended to the boundary in the request to ensure the boundary follows the specification.\n */\n boundary?: string;\n}\n\n/**\n * Types of bodies supported on the request.\n * NodeJS.ReadableStream and () =\\> NodeJS.ReadableStream is Node only.\n * Blob, ReadableStream<Uint8Array>, and () =\\> ReadableStream<Uint8Array> are browser only.\n */\nexport type RequestBodyType =\n | NodeJS.ReadableStream\n | (() => NodeJS.ReadableStream)\n | ReadableStream<Uint8Array>\n | (() => ReadableStream<Uint8Array>)\n | Blob\n | ArrayBuffer\n | ArrayBufferView\n | FormData\n | string\n | null;\n\n/**\n * An interface compatible with NodeJS's `http.Agent`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface Agent {\n /**\n * Destroy any sockets that are currently in use by the agent.\n */\n destroy(): void;\n /**\n * For agents with keepAlive enabled, this sets the maximum number of sockets that will be left open in the free state.\n */\n maxFreeSockets: number;\n /**\n * Determines how many concurrent sockets the agent can have open per origin.\n */\n maxSockets: number;\n /**\n * An object which contains queues of requests that have not yet been assigned to sockets.\n */\n requests: unknown;\n /**\n * An object which contains arrays of sockets currently in use by the agent.\n */\n sockets: unknown;\n}\n\n/**\n * Metadata about a request being made by the pipeline.\n */\nexport interface PipelineRequest {\n /**\n * List of authentication schemes used for this specific request.\n * These schemes define how the request will be authenticated.\n *\n * If values are provided, these schemes override the client level authentication schemes.\n * If an empty array is provided, it explicitly specifies no authentication for the request.\n * If not provided at the request level, the client level authentication schemes will be used.\n */\n authSchemes?: AuthScheme[];\n\n /**\n * The URL to make the request to.\n */\n url: string;\n\n /**\n * The HTTP method to use when making the request.\n */\n method: HttpMethods;\n\n /**\n * The HTTP headers to use when making the request.\n */\n headers: HttpHeaders;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n * If the request is terminated, an `AbortError` is thrown.\n * Defaults to 0, which disables the timeout.\n */\n timeout: number;\n\n /**\n * Indicates whether the user agent should send cookies from the other domain in the case of cross-origin requests.\n * Defaults to false.\n */\n withCredentials: boolean;\n\n /**\n * A unique identifier for the request. Used for logging and tracing.\n */\n requestId: string;\n\n /**\n * The HTTP body content (if any)\n */\n body?: RequestBodyType;\n\n /**\n * Body for a multipart request.\n */\n multipartBody?: MultipartRequestBody;\n\n /**\n * To simulate a browser form post\n */\n formData?: FormDataMap;\n\n /**\n * A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.\n * When streamResponseStatusCodes contains the value Number.POSITIVE_INFINITY any status would be treated as a stream.\n */\n streamResponseStatusCodes?: Set<number>;\n\n /**\n * Proxy configuration.\n */\n proxySettings?: ProxySettings;\n\n /**\n * If the connection should not be reused.\n */\n disableKeepAlive?: boolean;\n\n /**\n * Used to abort the request later.\n */\n abortSignal?: AbortSignal;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /** Callback which fires upon download progress. */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n\n /**\n * NODEJS ONLY\n *\n * A Node-only option to provide a custom `http.Agent`/`https.Agent`.\n * Does nothing when running in the browser.\n */\n agent?: Agent;\n\n /**\n * BROWSER ONLY\n *\n * A browser only option to enable browser Streams. If this option is set and a response is a stream\n * the response will have a property `browserStream` instead of `blobBody` which will be undefined.\n *\n * Default value is false\n */\n enableBrowserStreams?: boolean;\n\n /** Settings for configuring TLS authentication */\n tlsSettings?: TlsSettings;\n\n /**\n * Additional options to set on the request. This provides a way to override\n * existing ones or provide request properties that are not declared.\n *\n * For possible valid properties, see\n * - NodeJS https.request options: https://nodejs.org/api/http.html#httprequestoptions-callback\n * - Browser RequestInit: https://developer.mozilla.org/en-US/docs/Web/API/RequestInit\n *\n * WARNING: Options specified here will override any properties of same names when request is sent by {@link HttpClient}.\n */\n requestOverrides?: Record<string, unknown>;\n}\n\n/**\n * Metadata about a response received by the pipeline.\n */\nexport interface PipelineResponse {\n /**\n * The request that generated this response.\n */\n request: PipelineRequest;\n /**\n * The HTTP status code of the response.\n */\n status: number;\n /**\n * The HTTP response headers.\n */\n headers: HttpHeaders;\n\n /**\n * The response body as text (string format)\n */\n bodyAsText?: string | null;\n\n /**\n * BROWSER ONLY\n *\n * The response body as a browser Blob.\n * Always undefined in node.js.\n */\n blobBody?: Promise<Blob>;\n\n /**\n * BROWSER ONLY\n *\n * The response body as a browser ReadableStream.\n * Always undefined in node.js.\n */\n browserStreamBody?: ReadableStream<Uint8Array>;\n\n /**\n * NODEJS ONLY\n *\n * The response body as a node.js Readable stream.\n * Always undefined in the browser.\n */\n readableStreamBody?: NodeJS.ReadableStream;\n}\n\n/**\n * A simple interface for making a pipeline request and receiving a response.\n */\nexport type SendRequest = (request: PipelineRequest) => Promise<PipelineResponse>;\n\n/**\n * The required interface for a client that makes HTTP requests\n * on behalf of a pipeline.\n */\nexport interface HttpClient {\n /**\n * The method that makes the request and returns a response.\n */\n sendRequest: SendRequest;\n}\n\n/**\n * Fired in response to upload or download progress.\n */\nexport type TransferProgressEvent = {\n /**\n * The number of bytes loaded so far.\n */\n loadedBytes: number;\n};\n\n// UNBRANDED DIFFERENCE: HttpMethods are defined at the top level in unbranded instead of core-util since we don't\n// need to worry about creating a cyclic dependency\n/**\n * Supported HTTP methods to use when making requests.\n */\nexport type HttpMethods =\n | \"GET\"\n | \"PUT\"\n | \"POST\"\n | \"DELETE\"\n | \"PATCH\"\n | \"HEAD\"\n | \"OPTIONS\"\n | \"TRACE\";\n\n/**\n * Options to configure a proxy for outgoing requests (Node.js only).\n */\nexport interface ProxySettings {\n /**\n * The proxy's host address.\n * Must include the protocol (e.g., http:// or https://).\n */\n host: string;\n\n /**\n * The proxy host's port.\n */\n port: number;\n\n /**\n * The user name to authenticate with the proxy, if required.\n */\n username?: string;\n\n /**\n * The password to authenticate with the proxy, if required.\n */\n password?: string;\n}\n\n/**\n * Each form data entry can be a string, Blob, or a File. If you wish to pass a file with a name but do not have\n * access to the File class, you can use the createFile helper to create one.\n */\nexport type FormDataValue = string | Blob | File;\n\n/**\n * A simple object that provides form data, as if from a browser form.\n */\nexport type FormDataMap = { [key: string]: FormDataValue | FormDataValue[] };\n\n/**\n * Options that control how to retry failed requests.\n */\nexport interface PipelineRetryOptions {\n /**\n * The maximum number of retry attempts. Defaults to 3.\n */\n maxRetries?: number;\n\n /**\n * The amount of delay in milliseconds between retry attempts. Defaults to 1000\n * (1 second). The delay increases exponentially with each retry up to a maximum\n * specified by maxRetryDelayInMs.\n */\n retryDelayInMs?: number;\n\n /**\n * The maximum delay in milliseconds allowed before retrying an operation. Defaults\n * to 64000 (64 seconds).\n */\n maxRetryDelayInMs?: number;\n}\n\n/**\n * Represents a certificate credential for authentication.\n */\nexport interface CertificateCredential {\n /**\n * Optionally override the trusted CA certificates. Default is to trust\n * the well-known CAs curated by Mozilla. Mozilla's CAs are completely\n * replaced when CAs are explicitly specified using this option.\n */\n ca?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Cert chains in PEM format. One cert chain should be provided per\n * private key. Each cert chain should consist of the PEM formatted\n * certificate for a provided private key, followed by the PEM\n * formatted intermediate certificates (if any), in order, and not\n * including the root CA (the root CA must be pre-known to the peer,\n * see ca). When providing multiple cert chains, they do not have to\n * be in the same order as their private keys in key. If the\n * intermediate certificates are not provided, the peer will not be\n * able to validate the certificate, and the handshake will fail.\n */\n cert?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Private keys in PEM format. PEM allows the option of private keys\n * being encrypted. Encrypted keys will be decrypted with\n * options.passphrase. Multiple keys using different algorithms can be\n * provided either as an array of unencrypted key strings or buffers,\n * or an array of objects in the form `{pem: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n key?: string | Buffer | Array<Buffer | KeyObject> | undefined;\n /**\n * Shared passphrase used for a single private key and/or a PFX.\n */\n passphrase?: string | undefined;\n /**\n * PFX or PKCS12 encoded private key and certificate chain. pfx is an\n * alternative to providing key and cert individually. PFX is usually\n * encrypted, if it is, passphrase will be used to decrypt it. Multiple\n * PFX can be provided either as an array of unencrypted PFX buffers,\n * or an array of objects in the form `{buf: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;\n}\n\n/**\n * Represents a certificate for TLS authentication.\n */\nexport interface TlsSettings {\n /**\n * Optionally override the trusted CA certificates. Default is to trust\n * the well-known CAs curated by Mozilla. Mozilla's CAs are completely\n * replaced when CAs are explicitly specified using this option.\n */\n ca?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Cert chains in PEM format. One cert chain should be provided per\n * private key. Each cert chain should consist of the PEM formatted\n * certificate for a provided private key, followed by the PEM\n * formatted intermediate certificates (if any), in order, and not\n * including the root CA (the root CA must be pre-known to the peer,\n * see ca). When providing multiple cert chains, they do not have to\n * be in the same order as their private keys in key. If the\n * intermediate certificates are not provided, the peer will not be\n * able to validate the certificate, and the handshake will fail.\n */\n cert?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Private keys in PEM format. PEM allows the option of private keys\n * being encrypted. Encrypted keys will be decrypted with\n * options.passphrase. Multiple keys using different algorithms can be\n * provided either as an array of unencrypted key strings or buffers,\n * or an array of objects in the form `{pem: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n key?: string | Buffer | Array<Buffer | KeyObject> | undefined;\n /**\n * Shared passphrase used for a single private key and/or a PFX.\n */\n passphrase?: string | undefined;\n /**\n * PFX or PKCS12 encoded private key and certificate chain. pfx is an\n * alternative to providing key and cert individually. PFX is usually\n * encrypted, if it is, passphrase will be used to decrypt it. Multiple\n * PFX can be provided either as an array of unencrypted PFX buffers,\n * or an array of objects in the form `{buf: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;\n}\n\n/**\n * An interface compatible with NodeJS's `tls.KeyObject`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface KeyObject {\n /**\n * Private keys in PEM format.\n */\n pem: string | Buffer;\n /**\n * Optional passphrase.\n */\n passphrase?: string | undefined;\n}\n\n/**\n * An interface compatible with NodeJS's `tls.PxfObject`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface PxfObject {\n /**\n * PFX or PKCS12 encoded private key and certificate chain.\n */\n buf: string | Buffer;\n /**\n * Optional passphrase.\n */\n passphrase?: string | undefined;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AuthScheme } from \"./auth/schemes.js\";\nimport type { NodeBuffer, NodeReadableStream, WebReadableStream } from \"#platform/types\";\n\n/**\n * A HttpHeaders collection represented as a simple JSON object.\n */\nexport type RawHttpHeaders = { [headerName: string]: string };\n\n/**\n * A HttpHeaders collection for input, represented as a simple JSON object.\n */\nexport type RawHttpHeadersInput = Record<string, string | number | boolean>;\n\n/**\n * Represents a set of HTTP headers on a request/response.\n * Header names are treated as case insensitive.\n */\nexport interface HttpHeaders extends Iterable<[string, string]> {\n /**\n * Returns the value of a specific header or undefined if not set.\n * @param name - The name of the header to retrieve.\n */\n get(name: string): string | undefined;\n /**\n * Returns true if the specified header exists.\n * @param name - The name of the header to check.\n */\n has(name: string): boolean;\n /**\n * Sets a specific header with a given value.\n * @param name - The name of the header to set.\n * @param value - The value to use for the header.\n */\n set(name: string, value: string | number | boolean): void;\n /**\n * Removes a specific header from the collection.\n * @param name - The name of the header to delete.\n */\n delete(name: string): void;\n /**\n * Accesses a raw JS object that acts as a simple map\n * of header names to values.\n */\n toJSON(options?: { preserveCase?: boolean }): RawHttpHeaders;\n}\n\n/**\n * A part of the request body in a multipart request.\n */\nexport interface BodyPart {\n /**\n * The headers for this part of the multipart request.\n */\n headers: HttpHeaders;\n\n /**\n * The body of this part of the multipart request.\n */\n body:\n | ((() => WebReadableStream<Uint8Array>) | (() => NodeReadableStream))\n | WebReadableStream<Uint8Array>\n | NodeReadableStream\n | Uint8Array\n | Blob;\n}\n\n/**\n * A request body consisting of multiple parts.\n */\nexport interface MultipartRequestBody {\n /**\n * The parts of the request body.\n */\n parts: BodyPart[];\n\n /**\n * The boundary separating each part of the request body.\n * If not specified, a random boundary will be generated.\n *\n * When specified, '--' will be prepended to the boundary in the request to ensure the boundary follows the specification.\n */\n boundary?: string;\n}\n\n/**\n * Types of bodies supported on the request.\n * NodeJS.ReadableStream and () =\\> NodeJS.ReadableStream is Node only.\n * Blob, ReadableStream<Uint8Array>, and () =\\> ReadableStream<Uint8Array> are browser only.\n */\nexport type RequestBodyType =\n | NodeReadableStream\n | (() => NodeReadableStream)\n | WebReadableStream<Uint8Array>\n | (() => WebReadableStream<Uint8Array>)\n | Blob\n | ArrayBuffer\n | ArrayBufferView\n | FormData\n | string\n | null;\n\n/**\n * An interface compatible with NodeJS's `http.Agent`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface Agent {\n /**\n * Destroy any sockets that are currently in use by the agent.\n */\n destroy(): void;\n /**\n * For agents with keepAlive enabled, this sets the maximum number of sockets that will be left open in the free state.\n */\n maxFreeSockets: number;\n /**\n * Determines how many concurrent sockets the agent can have open per origin.\n */\n maxSockets: number;\n /**\n * An object which contains queues of requests that have not yet been assigned to sockets.\n */\n requests: unknown;\n /**\n * An object which contains arrays of sockets currently in use by the agent.\n */\n sockets: unknown;\n}\n\n/**\n * Metadata about a request being made by the pipeline.\n */\nexport interface PipelineRequest {\n /**\n * List of authentication schemes used for this specific request.\n * These schemes define how the request will be authenticated.\n *\n * If values are provided, these schemes override the client level authentication schemes.\n * If an empty array is provided, it explicitly specifies no authentication for the request.\n * If not provided at the request level, the client level authentication schemes will be used.\n */\n authSchemes?: AuthScheme[];\n\n /**\n * The URL to make the request to.\n */\n url: string;\n\n /**\n * The HTTP method to use when making the request.\n */\n method: HttpMethods;\n\n /**\n * The HTTP headers to use when making the request.\n */\n headers: HttpHeaders;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n * If the request is terminated, an `AbortError` is thrown.\n * Defaults to 0, which disables the timeout.\n */\n timeout: number;\n\n /**\n * Indicates whether the user agent should send cookies from the other domain in the case of cross-origin requests.\n * Defaults to false.\n */\n withCredentials: boolean;\n\n /**\n * A unique identifier for the request. Used for logging and tracing.\n */\n requestId: string;\n\n /**\n * The HTTP body content (if any)\n */\n body?: RequestBodyType;\n\n /**\n * Body for a multipart request.\n */\n multipartBody?: MultipartRequestBody;\n\n /**\n * To simulate a browser form post\n */\n formData?: FormDataMap;\n\n /**\n * A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.\n * When streamResponseStatusCodes contains the value Number.POSITIVE_INFINITY any status would be treated as a stream.\n */\n streamResponseStatusCodes?: Set<number>;\n\n /**\n * Proxy configuration.\n */\n proxySettings?: ProxySettings;\n\n /**\n * If the connection should not be reused.\n */\n disableKeepAlive?: boolean;\n\n /**\n * Used to abort the request later.\n */\n abortSignal?: AbortSignal;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /** Callback which fires upon download progress. */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n\n /**\n * NODEJS ONLY\n *\n * A Node-only option to provide a custom `http.Agent`/`https.Agent`.\n * Does nothing when running in the browser.\n */\n agent?: Agent;\n\n /**\n * BROWSER ONLY\n *\n * A browser only option to enable browser Streams. If this option is set and a response is a stream\n * the response will have a property `browserStream` instead of `blobBody` which will be undefined.\n *\n * Default value is false\n */\n enableBrowserStreams?: boolean;\n\n /** Settings for configuring TLS authentication */\n tlsSettings?: TlsSettings;\n\n /**\n * Additional options to set on the request. This provides a way to override\n * existing ones or provide request properties that are not declared.\n *\n * For possible valid properties, see\n * - NodeJS https.request options: https://nodejs.org/api/http.html#httprequestoptions-callback\n * - Browser RequestInit: https://developer.mozilla.org/en-US/docs/Web/API/RequestInit\n *\n * WARNING: Options specified here will override any properties of same names when request is sent by {@link HttpClient}.\n */\n requestOverrides?: Record<string, unknown>;\n}\n\n/**\n * Metadata about a response received by the pipeline.\n */\nexport interface PipelineResponse {\n /**\n * The request that generated this response.\n */\n request: PipelineRequest;\n /**\n * The HTTP status code of the response.\n */\n status: number;\n /**\n * The HTTP response headers.\n */\n headers: HttpHeaders;\n\n /**\n * The response body as text (string format)\n */\n bodyAsText?: string | null;\n\n /**\n * BROWSER ONLY\n *\n * The response body as a browser Blob.\n * Always undefined in node.js.\n */\n blobBody?: Promise<Blob>;\n\n /**\n * BROWSER ONLY\n *\n * The response body as a browser ReadableStream.\n * Always undefined in node.js.\n */\n browserStreamBody?: WebReadableStream<Uint8Array>;\n\n /**\n * NODEJS ONLY\n *\n * The response body as a node.js Readable stream.\n * Always undefined in the browser.\n */\n readableStreamBody?: NodeReadableStream;\n}\n\n/**\n * A simple interface for making a pipeline request and receiving a response.\n */\nexport type SendRequest = (request: PipelineRequest) => Promise<PipelineResponse>;\n\n/**\n * The required interface for a client that makes HTTP requests\n * on behalf of a pipeline.\n */\nexport interface HttpClient {\n /**\n * The method that makes the request and returns a response.\n */\n sendRequest: SendRequest;\n}\n\n/**\n * Fired in response to upload or download progress.\n */\nexport type TransferProgressEvent = {\n /**\n * The number of bytes loaded so far.\n */\n loadedBytes: number;\n};\n\n// UNBRANDED DIFFERENCE: HttpMethods are defined at the top level in unbranded instead of core-util since we don't\n// need to worry about creating a cyclic dependency\n/**\n * Supported HTTP methods to use when making requests.\n */\nexport type HttpMethods =\n | \"GET\"\n | \"PUT\"\n | \"POST\"\n | \"DELETE\"\n | \"PATCH\"\n | \"HEAD\"\n | \"OPTIONS\"\n | \"TRACE\";\n\n/**\n * Options to configure a proxy for outgoing requests (Node.js only).\n */\nexport interface ProxySettings {\n /**\n * The proxy's host address.\n * Must include the protocol (e.g., http:// or https://).\n */\n host: string;\n\n /**\n * The proxy host's port.\n */\n port: number;\n\n /**\n * The user name to authenticate with the proxy, if required.\n */\n username?: string;\n\n /**\n * The password to authenticate with the proxy, if required.\n */\n password?: string;\n}\n\n/**\n * Each form data entry can be a string, Blob, or a File. If you wish to pass a file with a name but do not have\n * access to the File class, you can use the createFile helper to create one.\n */\nexport type FormDataValue = string | Blob | File;\n\n/**\n * A simple object that provides form data, as if from a browser form.\n */\nexport type FormDataMap = { [key: string]: FormDataValue | FormDataValue[] };\n\n/**\n * Options that control how to retry failed requests.\n */\nexport interface PipelineRetryOptions {\n /**\n * The maximum number of retry attempts. Defaults to 3.\n */\n maxRetries?: number;\n\n /**\n * The amount of delay in milliseconds between retry attempts. Defaults to 1000\n * (1 second). The delay increases exponentially with each retry up to a maximum\n * specified by maxRetryDelayInMs.\n */\n retryDelayInMs?: number;\n\n /**\n * The maximum delay in milliseconds allowed before retrying an operation. Defaults\n * to 64000 (64 seconds).\n */\n maxRetryDelayInMs?: number;\n}\n\n/**\n * Represents a certificate credential for authentication.\n */\nexport interface CertificateCredential {\n /**\n * Optionally override the trusted CA certificates. Default is to trust\n * the well-known CAs curated by Mozilla. Mozilla's CAs are completely\n * replaced when CAs are explicitly specified using this option.\n */\n ca?: string | NodeBuffer | Array<string | NodeBuffer> | undefined;\n /**\n * Cert chains in PEM format. One cert chain should be provided per\n * private key. Each cert chain should consist of the PEM formatted\n * certificate for a provided private key, followed by the PEM\n * formatted intermediate certificates (if any), in order, and not\n * including the root CA (the root CA must be pre-known to the peer,\n * see ca). When providing multiple cert chains, they do not have to\n * be in the same order as their private keys in key. If the\n * intermediate certificates are not provided, the peer will not be\n * able to validate the certificate, and the handshake will fail.\n */\n cert?: string | NodeBuffer | Array<string | NodeBuffer> | undefined;\n /**\n * Private keys in PEM format. PEM allows the option of private keys\n * being encrypted. Encrypted keys will be decrypted with\n * options.passphrase. Multiple keys using different algorithms can be\n * provided either as an array of unencrypted key strings or buffers,\n * or an array of objects in the form `{pem: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n key?: string | NodeBuffer | Array<NodeBuffer | KeyObject> | undefined;\n /**\n * Shared passphrase used for a single private key and/or a PFX.\n */\n passphrase?: string | undefined;\n /**\n * PFX or PKCS12 encoded private key and certificate chain. pfx is an\n * alternative to providing key and cert individually. PFX is usually\n * encrypted, if it is, passphrase will be used to decrypt it. Multiple\n * PFX can be provided either as an array of unencrypted PFX buffers,\n * or an array of objects in the form `{buf: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n pfx?: string | NodeBuffer | Array<string | NodeBuffer | PxfObject> | undefined;\n}\n\n/**\n * Represents a certificate for TLS authentication.\n */\nexport interface TlsSettings {\n /**\n * Optionally override the trusted CA certificates. Default is to trust\n * the well-known CAs curated by Mozilla. Mozilla's CAs are completely\n * replaced when CAs are explicitly specified using this option.\n */\n ca?: string | NodeBuffer | Array<string | NodeBuffer> | undefined;\n /**\n * Cert chains in PEM format. One cert chain should be provided per\n * private key. Each cert chain should consist of the PEM formatted\n * certificate for a provided private key, followed by the PEM\n * formatted intermediate certificates (if any), in order, and not\n * including the root CA (the root CA must be pre-known to the peer,\n * see ca). When providing multiple cert chains, they do not have to\n * be in the same order as their private keys in key. If the\n * intermediate certificates are not provided, the peer will not be\n * able to validate the certificate, and the handshake will fail.\n */\n cert?: string | NodeBuffer | Array<string | NodeBuffer> | undefined;\n /**\n * Private keys in PEM format. PEM allows the option of private keys\n * being encrypted. Encrypted keys will be decrypted with\n * options.passphrase. Multiple keys using different algorithms can be\n * provided either as an array of unencrypted key strings or buffers,\n * or an array of objects in the form `{pem: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n key?: string | NodeBuffer | Array<NodeBuffer | KeyObject> | undefined;\n /**\n * Shared passphrase used for a single private key and/or a PFX.\n */\n passphrase?: string | undefined;\n /**\n * PFX or PKCS12 encoded private key and certificate chain. pfx is an\n * alternative to providing key and cert individually. PFX is usually\n * encrypted, if it is, passphrase will be used to decrypt it. Multiple\n * PFX can be provided either as an array of unencrypted PFX buffers,\n * or an array of objects in the form `{buf: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n pfx?: string | NodeBuffer | Array<string | NodeBuffer | PxfObject> | undefined;\n}\n\n/**\n * An interface compatible with NodeJS's `tls.KeyObject`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface KeyObject {\n /**\n * Private keys in PEM format.\n */\n pem: string | NodeBuffer;\n /**\n * Optional passphrase.\n */\n passphrase?: string | undefined;\n}\n\n/**\n * An interface compatible with NodeJS's `tls.PxfObject`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface PxfObject {\n /**\n * PFX or PKCS12 encoded private key and certificate chain.\n */\n buf: string | NodeBuffer;\n /**\n * Optional passphrase.\n */\n passphrase?: string | undefined;\n}\n"]}
@@ -1,7 +1,8 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { log } from "./log.js";
4
- const debugEnvVariable = (typeof process !== "undefined" && process.env && process.env.DEBUG) || undefined;
4
+ import { getEnvironmentVariable } from "../env.js";
5
+ const debugEnvVariable = getEnvironmentVariable("DEBUG");
5
6
  let enabledString;
6
7
  let enabledNamespaces = [];
7
8
  let skippedNamespaces = [];
@@ -1 +1 @@
1
- {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/logger/debug.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAgE/B,MAAM,gBAAgB,GACpB,CAAC,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC;AAEpF,IAAI,aAAiC,CAAC;AACtC,IAAI,iBAAiB,GAAa,EAAE,CAAC;AACrC,IAAI,iBAAiB,GAAa,EAAE,CAAC;AACrC,MAAM,SAAS,GAAe,EAAE,CAAC;AAEjC,IAAI,gBAAgB,EAAE,CAAC;IACrB,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,QAAQ,GAAU,MAAM,CAAC,MAAM,CACnC,CAAC,SAAiB,EAAY,EAAE;IAC9B,OAAO,cAAc,CAAC,SAAS,CAAC,CAAC;AACnC,CAAC,EACD;IACE,MAAM;IACN,OAAO;IACP,OAAO;IACP,GAAG;CACJ,CACF,CAAC;AAEF,SAAS,MAAM,CAAC,UAAkB;IAChC,aAAa,GAAG,UAAU,CAAC;IAC3B,iBAAiB,GAAG,EAAE,CAAC;IACvB,iBAAiB,GAAG,EAAE,CAAC;IACvB,MAAM,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IACnE,KAAK,MAAM,EAAE,IAAI,aAAa,EAAE,CAAC;QAC/B,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAA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AAE;QACjD,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC;QAC3B,OAAO;QACP,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,SAAS;QACT,MAAM;KACP,CAAC,CAAC;IAEH,SAAS,KAAK,CAAC,GAAG,IAAW;QAC3B,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;YACzB,OAAO;QACT,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,CAAC;QACD,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAE5B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,OAAO;IACd,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACf,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,MAAM,CAAiB,SAAiB;IAC/C,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,IAAI,CAAC,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC;IACrE,WAAW,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IAC3B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { log } from \"./log.js\";\n\n/**\n * A simple mechanism for enabling logging.\n * Intended to mimic the publicly available `debug` package.\n */\nexport interface Debug {\n /**\n * Creates a new logger with the given namespace.\n */\n (namespace: string): Debugger;\n /**\n * The default log method (defaults to console)\n */\n log: (...args: any[]) => void;\n /**\n * Enables a particular set of namespaces.\n * To enable multiple separate them with commas, e.g. \"info,debug\".\n * Supports wildcards, e.g. \"typeSpecRuntime:*\"\n * Supports skip syntax, e.g. \"typeSpecRuntime:*,-typeSpecRuntime:storage:*\" will enable\n * everything under typeSpecRuntime except for things under typeSpecRuntime:storage.\n */\n enable: (namespaces: string) => void;\n /**\n * Checks if a particular namespace is enabled.\n */\n enabled: (namespace: string) => boolean;\n /**\n * Disables all logging, returns what was previously enabled.\n */\n disable: () => string;\n}\n\n/**\n * A log function that can be dynamically enabled and redirected.\n */\nexport interface Debugger {\n /**\n * Logs the given arguments to the `log` method.\n */\n (...args: any[]): void;\n /**\n * True if this logger is active and logging.\n */\n enabled: boolean;\n /**\n * Used to cleanup/remove this logger.\n */\n destroy: () => boolean;\n /**\n * The current log method. Can be overridden to redirect output.\n */\n log: (...args: any[]) => void;\n /**\n * The namespace of this logger.\n */\n namespace: string;\n /**\n * Extends this logger with a child namespace.\n * Namespaces are separated with a ':' character.\n */\n extend: (namespace: string) => Debugger;\n}\n\nconst debugEnvVariable =\n (typeof process !== \"undefined\" && process.env && process.env.DEBUG) || undefined;\n\nlet enabledString: string | undefined;\nlet enabledNamespaces: string[] = [];\nlet skippedNamespaces: string[] = [];\nconst debuggers: Debugger[] = [];\n\nif (debugEnvVariable) {\n enable(debugEnvVariable);\n}\n\nconst debugObj: Debug = Object.assign(\n (namespace: string): Debugger => {\n return createDebugger(namespace);\n },\n {\n enable,\n enabled,\n disable,\n log,\n },\n);\n\nfunction enable(namespaces: string): void {\n enabledString = namespaces;\n enabledNamespaces = [];\n skippedNamespaces = [];\n const namespaceList = namespaces.split(\",\").map((ns) => ns.trim());\n for (const ns of namespaceList) {\n if (ns.startsWith(\"-\")) {\n skippedNamespaces.push(ns.substring(1));\n } else {\n enabledNamespaces.push(ns);\n }\n }\n for (const instance of debuggers) {\n instance.enabled = enabled(instance.namespace);\n }\n}\n\nfunction enabled(namespace: string): boolean {\n if (namespace.endsWith(\"*\")) {\n return true;\n }\n\n for (const skipped of skippedNamespaces) {\n if (namespaceMatches(namespace, skipped)) {\n return false;\n }\n }\n for (const enabledNamespace of enabledNamespaces) {\n if (namespaceMatches(namespace, enabledNamespace)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Given a namespace, check if it matches a pattern.\n * Patterns only have a single wildcard character which is *.\n * The behavior of * is that it matches zero or more other characters.\n */\nfunction namespaceMatches(namespace: string, patternToMatch: string): boolean {\n // simple case, no pattern matching required\n if (patternToMatch.indexOf(\"*\") === -1) {\n return namespace === patternToMatch;\n }\n\n let pattern = patternToMatch;\n\n // normalize successive * if needed\n if (patternToMatch.indexOf(\"**\") !== -1) {\n const patternParts = [];\n let lastCharacter = \"\";\n for (const character of patternToMatch) {\n if (character === \"*\" && lastCharacter === \"*\") {\n continue;\n } else {\n lastCharacter = character;\n patternParts.push(character);\n }\n }\n pattern = patternParts.join(\"\");\n }\n\n let namespaceIndex = 0;\n let patternIndex = 0;\n const patternLength = pattern.length;\n const namespaceLength = namespace.length;\n let lastWildcard = -1;\n let lastWildcardNamespace = -1;\n\n while (namespaceIndex < namespaceLength && patternIndex < patternLength) {\n if (pattern[patternIndex] === \"*\") {\n lastWildcard = patternIndex;\n patternIndex++;\n if (patternIndex === patternLength) {\n // if wildcard is the last character, it will match the remaining namespace string\n return true;\n }\n // now we let the wildcard eat characters until we match the next literal in the pattern\n while (namespace[namespaceIndex] !== pattern[patternIndex]) {\n namespaceIndex++;\n // reached the end of the namespace without a match\n if (namespaceIndex === namespaceLength) {\n return false;\n }\n }\n\n // now that we have a match, let's try to continue on\n // however, it's possible we could find a later match\n // so keep a reference in case we have to backtrack\n lastWildcardNamespace = namespaceIndex;\n namespaceIndex++;\n patternIndex++;\n continue;\n } else if (pattern[patternIndex] === namespace[namespaceIndex]) {\n // simple case: literal pattern matches so keep going\n patternIndex++;\n namespaceIndex++;\n } else if (lastWildcard >= 0) {\n // special case: we don't have a literal match, but there is a previous wildcard\n // which we can backtrack to and try having the wildcard eat the match instead\n patternIndex = lastWildcard + 1;\n namespaceIndex = lastWildcardNamespace + 1;\n // we've reached the end of the namespace without a match\n if (namespaceIndex === namespaceLength) {\n return false;\n }\n // similar to the previous logic, let's keep going until we find the next literal match\n while (namespace[namespaceIndex] !== pattern[patternIndex]) {\n namespaceIndex++;\n if (namespaceIndex === namespaceLength) {\n return false;\n }\n }\n lastWildcardNamespace = namespaceIndex;\n namespaceIndex++;\n patternIndex++;\n continue;\n } else {\n return false;\n }\n }\n\n const namespaceDone = namespaceIndex === namespace.length;\n const patternDone = patternIndex === pattern.length;\n // this is to detect the case of an unneeded final wildcard\n // e.g. the pattern `ab*` should match the string `ab`\n const trailingWildCard = patternIndex === pattern.length - 1 && pattern[patternIndex] === \"*\";\n return namespaceDone && (patternDone || trailingWildCard);\n}\n\nfunction disable(): string {\n const result = enabledString || \"\";\n enable(\"\");\n return result;\n}\n\nfunction createDebugger(namespace: string): Debugger {\n const newDebugger: Debugger = Object.assign(debug, {\n enabled: enabled(namespace),\n destroy,\n log: debugObj.log,\n namespace,\n extend,\n });\n\n function debug(...args: any[]): void {\n if (!newDebugger.enabled) {\n return;\n }\n if (args.length > 0) {\n args[0] = `${namespace} ${args[0]}`;\n }\n newDebugger.log(...args);\n }\n\n debuggers.push(newDebugger);\n\n return newDebugger;\n}\n\nfunction destroy(this: Debugger): boolean {\n const index = debuggers.indexOf(this);\n if (index >= 0) {\n debuggers.splice(index, 1);\n return true;\n }\n return false;\n}\n\nfunction extend(this: Debugger, namespace: string): Debugger {\n const newDebugger = createDebugger(`${this.namespace}:${namespace}`);\n newDebugger.log = this.log;\n return newDebugger;\n}\n\nexport default debugObj;\n"]}
1
+ {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/logger/debug.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO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I,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,CAAC;QACD,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAE5B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,OAAO;IACd,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACf,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,MAAM,CAAiB,SAAiB;IAC/C,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,IAAI,CAAC,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC;IACrE,WAAW,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IAC3B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { log } from \"#platform/log\";\nimport { getEnvironmentVariable } from \"#platform/env\";\n\n/**\n * A simple mechanism for enabling logging.\n * Intended to mimic the publicly available `debug` package.\n */\nexport interface Debug {\n /**\n * Creates a new logger with the given namespace.\n */\n (namespace: string): Debugger;\n /**\n * The default log method (defaults to console)\n */\n log: (...args: any[]) => void;\n /**\n * Enables a particular set of namespaces.\n * To enable multiple separate them with commas, e.g. \"info,debug\".\n * Supports wildcards, e.g. \"typeSpecRuntime:*\"\n * Supports skip syntax, e.g. \"typeSpecRuntime:*,-typeSpecRuntime:storage:*\" will enable\n * everything under typeSpecRuntime except for things under typeSpecRuntime:storage.\n */\n enable: (namespaces: string) => void;\n /**\n * Checks if a particular namespace is enabled.\n */\n enabled: (namespace: string) => boolean;\n /**\n * Disables all logging, returns what was previously enabled.\n */\n disable: () => string;\n}\n\n/**\n * A log function that can be dynamically enabled and redirected.\n */\nexport interface Debugger {\n /**\n * Logs the given arguments to the `log` method.\n */\n (...args: any[]): void;\n /**\n * True if this logger is active and logging.\n */\n enabled: boolean;\n /**\n * Used to cleanup/remove this logger.\n */\n destroy: () => boolean;\n /**\n * The current log method. Can be overridden to redirect output.\n */\n log: (...args: any[]) => void;\n /**\n * The namespace of this logger.\n */\n namespace: string;\n /**\n * Extends this logger with a child namespace.\n * Namespaces are separated with a ':' character.\n */\n extend: (namespace: string) => Debugger;\n}\n\nconst debugEnvVariable = getEnvironmentVariable(\"DEBUG\");\n\nlet enabledString: string | undefined;\nlet enabledNamespaces: string[] = [];\nlet skippedNamespaces: string[] = [];\nconst debuggers: Debugger[] = [];\n\nif (debugEnvVariable) {\n enable(debugEnvVariable);\n}\n\nconst debugObj: Debug = Object.assign(\n (namespace: string): Debugger => {\n return createDebugger(namespace);\n },\n {\n enable,\n enabled,\n disable,\n log,\n },\n);\n\nfunction enable(namespaces: string): void {\n enabledString = namespaces;\n enabledNamespaces = [];\n skippedNamespaces = [];\n const namespaceList = namespaces.split(\",\").map((ns) => ns.trim());\n for (const ns of namespaceList) {\n if (ns.startsWith(\"-\")) {\n skippedNamespaces.push(ns.substring(1));\n } else {\n enabledNamespaces.push(ns);\n }\n }\n for (const instance of debuggers) {\n instance.enabled = enabled(instance.namespace);\n }\n}\n\nfunction enabled(namespace: string): boolean {\n if (namespace.endsWith(\"*\")) {\n return true;\n }\n\n for (const skipped of skippedNamespaces) {\n if (namespaceMatches(namespace, skipped)) {\n return false;\n }\n }\n for (const enabledNamespace of enabledNamespaces) {\n if (namespaceMatches(namespace, enabledNamespace)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Given a namespace, check if it matches a pattern.\n * Patterns only have a single wildcard character which is *.\n * The behavior of * is that it matches zero or more other characters.\n */\nfunction namespaceMatches(namespace: string, patternToMatch: string): boolean {\n // simple case, no pattern matching required\n if (patternToMatch.indexOf(\"*\") === -1) {\n return namespace === patternToMatch;\n }\n\n let pattern = patternToMatch;\n\n // normalize successive * if needed\n if (patternToMatch.indexOf(\"**\") !== -1) {\n const patternParts = [];\n let lastCharacter = \"\";\n for (const character of patternToMatch) {\n if (character === \"*\" && lastCharacter === \"*\") {\n continue;\n } else {\n lastCharacter = character;\n patternParts.push(character);\n }\n }\n pattern = patternParts.join(\"\");\n }\n\n let namespaceIndex = 0;\n let patternIndex = 0;\n const patternLength = pattern.length;\n const namespaceLength = namespace.length;\n let lastWildcard = -1;\n let lastWildcardNamespace = -1;\n\n while (namespaceIndex < namespaceLength && patternIndex < patternLength) {\n if (pattern[patternIndex] === \"*\") {\n lastWildcard = patternIndex;\n patternIndex++;\n if (patternIndex === patternLength) {\n // if wildcard is the last character, it will match the remaining namespace string\n return true;\n }\n // now we let the wildcard eat characters until we match the next literal in the pattern\n while (namespace[namespaceIndex] !== pattern[patternIndex]) {\n namespaceIndex++;\n // reached the end of the namespace without a match\n if (namespaceIndex === namespaceLength) {\n return false;\n }\n }\n\n // now that we have a match, let's try to continue on\n // however, it's possible we could find a later match\n // so keep a reference in case we have to backtrack\n lastWildcardNamespace = namespaceIndex;\n namespaceIndex++;\n patternIndex++;\n continue;\n } else if (pattern[patternIndex] === namespace[namespaceIndex]) {\n // simple case: literal pattern matches so keep going\n patternIndex++;\n namespaceIndex++;\n } else if (lastWildcard >= 0) {\n // special case: we don't have a literal match, but there is a previous wildcard\n // which we can backtrack to and try having the wildcard eat the match instead\n patternIndex = lastWildcard + 1;\n namespaceIndex = lastWildcardNamespace + 1;\n // we've reached the end of the namespace without a match\n if (namespaceIndex === namespaceLength) {\n return false;\n }\n // similar to the previous logic, let's keep going until we find the next literal match\n while (namespace[namespaceIndex] !== pattern[patternIndex]) {\n namespaceIndex++;\n if (namespaceIndex === namespaceLength) {\n return false;\n }\n }\n lastWildcardNamespace = namespaceIndex;\n namespaceIndex++;\n patternIndex++;\n continue;\n } else {\n return false;\n }\n }\n\n const namespaceDone = namespaceIndex === namespace.length;\n const patternDone = patternIndex === pattern.length;\n // this is to detect the case of an unneeded final wildcard\n // e.g. the pattern `ab*` should match the string `ab`\n const trailingWildCard = patternIndex === pattern.length - 1 && pattern[patternIndex] === \"*\";\n return namespaceDone && (patternDone || trailingWildCard);\n}\n\nfunction disable(): string {\n const result = enabledString || \"\";\n enable(\"\");\n return result;\n}\n\nfunction createDebugger(namespace: string): Debugger {\n const newDebugger: Debugger = Object.assign(debug, {\n enabled: enabled(namespace),\n destroy,\n log: debugObj.log,\n namespace,\n extend,\n });\n\n function debug(...args: any[]): void {\n if (!newDebugger.enabled) {\n return;\n }\n if (args.length > 0) {\n args[0] = `${namespace} ${args[0]}`;\n }\n newDebugger.log(...args);\n }\n\n debuggers.push(newDebugger);\n\n return newDebugger;\n}\n\nfunction destroy(this: Debugger): boolean {\n const index = debuggers.indexOf(this);\n if (index >= 0) {\n debuggers.splice(index, 1);\n return true;\n }\n return false;\n}\n\nfunction extend(this: Debugger, namespace: string): Debugger {\n const newDebugger = createDebugger(`${this.namespace}:${namespace}`);\n newDebugger.log = this.log;\n return newDebugger;\n}\n\nexport default debugObj;\n"]}
@@ -1,6 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import debug from "./debug.js";
4
+ import { getEnvironmentVariable } from "../env.js";
4
5
  const TYPESPEC_RUNTIME_LOG_LEVELS = ["verbose", "info", "warning", "error"];
5
6
  const levelMap = {
6
7
  verbose: 400,
@@ -23,8 +24,7 @@ function isTypeSpecRuntimeLogLevel(level) {
23
24
  */
24
25
  export function createLoggerContext(options) {
25
26
  const registeredLoggers = new Set();
26
- const logLevelFromEnv = (typeof process !== "undefined" && process.env && process.env[options.logLevelEnvVarName]) ||
27
- undefined;
27
+ const logLevelFromEnv = getEnvironmentVariable(options.logLevelEnvVarName);
28
28
  let logLevel;
29
29
  const clientLogger = debug(options.namespace);
30
30
  clientLogger.log = (...args) => {
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/logger/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,YAAY,CAAC;AAiG/B,MAAM,2BAA2B,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAI5E,MAAM,QAAQ,GAAG;IACf,OAAO,EAAE,GAAG;IACZ,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,GAAG;IACZ,KAAK,EAAE,GAAG;CACX,CAAC;AAEF,SAAS,cAAc,CACrB,MAAmC,EACnC,KAAyD;IAEzD,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE;QACtB,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAAC,KAAa;IAC9C,OAAO,2BAA2B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAmC;IACrE,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC1D,MAAM,eAAe,GACnB,CAAC,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAC1F,SAAS,CAAC;IAEZ,IAAI,QAA6C,CAAC;IAElD,MAAM,YAAY,GAAgC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3E,YAAY,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE;QAC7B,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,C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D,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,OAAO,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport debug from \"./debug.js\";\n\nimport type { Debugger } from \"./debug.js\";\nexport type { Debugger };\n\n/**\n * The log levels supported by the logger.\n * The log levels in order of most verbose to least verbose are:\n * - verbose\n * - info\n * - warning\n * - error\n */\nexport type TypeSpecRuntimeLogLevel = \"verbose\" | \"info\" | \"warning\" | \"error\";\n\n/**\n * A TypeSpecRuntimeClientLogger is a function that can log to an appropriate severity level.\n */\nexport type TypeSpecRuntimeClientLogger = Debugger;\n\n/**\n * Defines the methods available on the SDK-facing logger.\n */\nexport interface TypeSpecRuntimeLogger {\n /**\n * Used for failures the program is unlikely to recover from,\n * such as Out of Memory.\n */\n error: Debugger;\n /**\n * Used when a function fails to perform its intended task.\n * Usually this means the function will throw an exception.\n * Not used for self-healing events (e.g. automatic retry)\n */\n warning: Debugger;\n /**\n * Used when a function operates normally.\n */\n info: Debugger;\n /**\n * Used for detailed troubleshooting scenarios. This is\n * intended for use by developers / system administrators\n * for diagnosing specific failures.\n */\n verbose: Debugger;\n}\n\n/**\n * todo doc\n */\nexport interface LoggerContext {\n /**\n * Immediately enables logging at the specified log level. If no level is specified, logging is disabled.\n * @param level - The log level to enable for logging.\n * Options from most verbose to least verbose are:\n * - verbose\n * - info\n * - warning\n * - error\n */\n setLogLevel(logLevel?: TypeSpecRuntimeLogLevel): void;\n\n /**\n * Retrieves the currently specified log level.\n */\n getLogLevel(): TypeSpecRuntimeLogLevel | undefined;\n\n /**\n * Creates a logger for use by the SDKs that inherits from `TypeSpecRuntimeLogger`.\n * @param namespace - The name of the SDK package.\n * @hidden\n */\n createClientLogger(namespace: string): TypeSpecRuntimeLogger;\n\n /**\n * The TypeSpecRuntimeClientLogger provides a mechanism for overriding where logs are output to.\n * By default, logs are sent to stderr.\n * Override the `log` method to redirect logs to another location.\n */\n logger: TypeSpecRuntimeClientLogger;\n}\n\n/**\n * Option for creating a TypeSpecRuntimeLoggerContext.\n */\nexport interface CreateLoggerContextOptions {\n /**\n * The name of the environment variable to check for the log level.\n */\n logLevelEnvVarName: string;\n\n /**\n * The namespace of the logger.\n */\n namespace: string;\n}\n\nconst TYPESPEC_RUNTIME_LOG_LEVELS = [\"verbose\", \"info\", \"warning\", \"error\"];\n\ntype DebuggerWithLogLevel = Debugger & { level: TypeSpecRuntimeLogLevel };\n\nconst levelMap = {\n verbose: 400,\n info: 300,\n warning: 200,\n error: 100,\n};\n\nfunction patchLogMethod(\n parent: TypeSpecRuntimeClientLogger,\n child: TypeSpecRuntimeClientLogger | DebuggerWithLogLevel,\n): void {\n child.log = (...args) => {\n parent.log(...args);\n };\n}\n\nfunction isTypeSpecRuntimeLogLevel(level: string): level is TypeSpecRuntimeLogLevel {\n return TYPESPEC_RUNTIME_LOG_LEVELS.includes(level);\n}\n\n/**\n * Creates a logger context base on the provided options.\n * @param options - The options for creating a logger context.\n * @returns The logger context.\n */\nexport function createLoggerContext(options: CreateLoggerContextOptions): LoggerContext {\n const registeredLoggers = new Set<DebuggerWithLogLevel>();\n const logLevelFromEnv =\n (typeof process !== \"undefined\" && process.env && process.env[options.logLevelEnvVarName]) ||\n undefined;\n\n let logLevel: TypeSpecRuntimeLogLevel | undefined;\n\n const clientLogger: TypeSpecRuntimeClientLogger = debug(options.namespace);\n clientLogger.log = (...args) => {\n debug.log(...args);\n };\n\n function contextSetLogLevel(level?: TypeSpecRuntimeLogLevel): void {\n if (level && !isTypeSpecRuntimeLogLevel(level)) {\n throw new Error(\n `Unknown log level '${level}'. Acceptable values: ${TYPESPEC_RUNTIME_LOG_LEVELS.join(\",\")}`,\n );\n }\n logLevel = level;\n\n const enabledNamespaces = [];\n for (const logger of registeredLoggers) {\n if (shouldEnable(logger)) {\n enabledNamespaces.push(logger.namespace);\n }\n }\n\n debug.enable(enabledNamespaces.join(\",\"));\n }\n\n if (logLevelFromEnv) {\n // avoid calling setLogLevel because we don't want a mis-set environment variable to crash\n if (isTypeSpecRuntimeLogLevel(logLevelFromEnv)) {\n contextSetLogLevel(logLevelFromEnv);\n } else {\n console.error(\n `${options.logLevelEnvVarName} set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${TYPESPEC_RUNTIME_LOG_LEVELS.join(\n \", \",\n )}.`,\n );\n }\n }\n\n function shouldEnable(logger: DebuggerWithLogLevel): boolean {\n return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]);\n }\n\n function createLogger(\n parent: TypeSpecRuntimeClientLogger,\n level: TypeSpecRuntimeLogLevel,\n ): DebuggerWithLogLevel {\n const logger: DebuggerWithLogLevel = Object.assign(parent.extend(level), {\n level,\n });\n\n patchLogMethod(parent, logger);\n\n if (shouldEnable(logger)) {\n const enabledNamespaces = debug.disable();\n debug.enable(enabledNamespaces + \",\" + logger.namespace);\n }\n\n registeredLoggers.add(logger);\n\n return logger;\n }\n\n function contextGetLogLevel(): TypeSpecRuntimeLogLevel | undefined {\n return logLevel;\n }\n\n function contextCreateClientLogger(namespace: string): TypeSpecRuntimeLogger {\n const clientRootLogger: TypeSpecRuntimeClientLogger = clientLogger.extend(namespace);\n patchLogMethod(clientLogger, clientRootLogger);\n return {\n error: createLogger(clientRootLogger, \"error\"),\n warning: createLogger(clientRootLogger, \"warning\"),\n info: createLogger(clientRootLogger, \"info\"),\n verbose: createLogger(clientRootLogger, \"verbose\"),\n };\n }\n\n return {\n setLogLevel: contextSetLogLevel,\n getLogLevel: contextGetLogLevel,\n createClientLogger: contextCreateClientLogger,\n logger: clientLogger,\n };\n}\n\nconst context = createLoggerContext({\n logLevelEnvVarName: \"TYPESPEC_RUNTIME_LOG_LEVEL\",\n namespace: \"typeSpecRuntime\",\n});\n\n/**\n * Immediately enables logging at the specified log level. If no level is specified, logging is disabled.\n * @param level - The log level to enable for logging.\n * Options from most verbose to least verbose are:\n * - verbose\n * - info\n * - warning\n * - error\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const TypeSpecRuntimeLogger: TypeSpecRuntimeClientLogger = context.logger;\n\n/**\n * Retrieves the currently specified log level.\n */\nexport function setLogLevel(logLevel?: TypeSpecRuntimeLogLevel): void {\n context.setLogLevel(logLevel);\n}\n\n/**\n * Retrieves the currently specified log level.\n */\nexport function getLogLevel(): TypeSpecRuntimeLogLevel | undefined {\n return context.getLogLevel();\n}\n\n/**\n * Creates a logger for use by the SDKs that inherits from `TypeSpecRuntimeLogger`.\n * @param namespace - The name of the SDK package.\n * @hidden\n */\nexport function createClientLogger(namespace: string): TypeSpecRuntimeLogger {\n return context.createClientLogger(namespace);\n}\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/logger/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAiGvD,MAAM,2BAA2B,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAI5E,MAAM,QAAQ,GAAG;IACf,OAAO,EAAE,GAAG;IACZ,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,GAAG;IACZ,KAAK,EAAE,GAAG;CACX,CAAC;AAEF,SAAS,cAAc,CACrB,MAAmC,EACnC,KAAyD;IAEzD,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE;QACtB,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAAC,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gBAAgB,EAAE,SAAS,CAAC;SACnD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,WAAW,EAAE,kBAAkB;QAC/B,WAAW,EAAE,kBAAkB;QAC/B,kBAAkB,EAAE,yBAAyB;QAC7C,MAAM,EAAE,YAAY;KACrB,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,GAAG,mBAAmB,CAAC;IAClC,kBAAkB,EAAE,4BAA4B;IAChD,SAAS,EAAE,iBAAiB;CAC7B,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAAgC,OAAO,CAAC,MAAM,CAAC;AAEjF;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,QAAkC;IAC5D,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,OAAO,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport debug from \"./debug.js\";\nimport { getEnvironmentVariable } from \"#platform/env\";\n\nimport type { Debugger } from \"./debug.js\";\nexport type { Debugger };\n\n/**\n * The log levels supported by the logger.\n * The log levels in order of most verbose to least verbose are:\n * - verbose\n * - info\n * - warning\n * - error\n */\nexport type TypeSpecRuntimeLogLevel = \"verbose\" | \"info\" | \"warning\" | \"error\";\n\n/**\n * A TypeSpecRuntimeClientLogger is a function that can log to an appropriate severity level.\n */\nexport type TypeSpecRuntimeClientLogger = Debugger;\n\n/**\n * Defines the methods available on the SDK-facing logger.\n */\nexport interface TypeSpecRuntimeLogger {\n /**\n * Used for failures the program is unlikely to recover from,\n * such as Out of Memory.\n */\n error: Debugger;\n /**\n * Used when a function fails to perform its intended task.\n * Usually this means the function will throw an exception.\n * Not used for self-healing events (e.g. automatic retry)\n */\n warning: Debugger;\n /**\n * Used when a function operates normally.\n */\n info: Debugger;\n /**\n * Used for detailed troubleshooting scenarios. This is\n * intended for use by developers / system administrators\n * for diagnosing specific failures.\n */\n verbose: Debugger;\n}\n\n/**\n * todo doc\n */\nexport interface LoggerContext {\n /**\n * Immediately enables logging at the specified log level. If no level is specified, logging is disabled.\n * @param level - The log level to enable for logging.\n * Options from most verbose to least verbose are:\n * - verbose\n * - info\n * - warning\n * - error\n */\n setLogLevel(logLevel?: TypeSpecRuntimeLogLevel): void;\n\n /**\n * Retrieves the currently specified log level.\n */\n getLogLevel(): TypeSpecRuntimeLogLevel | undefined;\n\n /**\n * Creates a logger for use by the SDKs that inherits from `TypeSpecRuntimeLogger`.\n * @param namespace - The name of the SDK package.\n * @hidden\n */\n createClientLogger(namespace: string): TypeSpecRuntimeLogger;\n\n /**\n * The TypeSpecRuntimeClientLogger provides a mechanism for overriding where logs are output to.\n * By default, logs are sent to stderr.\n * Override the `log` method to redirect logs to another location.\n */\n logger: TypeSpecRuntimeClientLogger;\n}\n\n/**\n * Option for creating a TypeSpecRuntimeLoggerContext.\n */\nexport interface CreateLoggerContextOptions {\n /**\n * The name of the environment variable to check for the log level.\n */\n logLevelEnvVarName: string;\n\n /**\n * The namespace of the logger.\n */\n namespace: string;\n}\n\nconst TYPESPEC_RUNTIME_LOG_LEVELS = [\"verbose\", \"info\", \"warning\", \"error\"];\n\ntype DebuggerWithLogLevel = Debugger & { level: TypeSpecRuntimeLogLevel };\n\nconst levelMap = {\n verbose: 400,\n info: 300,\n warning: 200,\n error: 100,\n};\n\nfunction patchLogMethod(\n parent: TypeSpecRuntimeClientLogger,\n child: TypeSpecRuntimeClientLogger | DebuggerWithLogLevel,\n): void {\n child.log = (...args) => {\n parent.log(...args);\n };\n}\n\nfunction isTypeSpecRuntimeLogLevel(level: string): level is TypeSpecRuntimeLogLevel {\n return TYPESPEC_RUNTIME_LOG_LEVELS.includes(level);\n}\n\n/**\n * Creates a logger context base on the provided options.\n * @param options - The options for creating a logger context.\n * @returns The logger context.\n */\nexport function createLoggerContext(options: CreateLoggerContextOptions): LoggerContext {\n const registeredLoggers = new Set<DebuggerWithLogLevel>();\n const logLevelFromEnv = getEnvironmentVariable(options.logLevelEnvVarName);\n\n let logLevel: TypeSpecRuntimeLogLevel | undefined;\n\n const clientLogger: TypeSpecRuntimeClientLogger = debug(options.namespace);\n clientLogger.log = (...args) => {\n debug.log(...args);\n };\n\n function contextSetLogLevel(level?: TypeSpecRuntimeLogLevel): void {\n if (level && !isTypeSpecRuntimeLogLevel(level)) {\n throw new Error(\n `Unknown log level '${level}'. Acceptable values: ${TYPESPEC_RUNTIME_LOG_LEVELS.join(\",\")}`,\n );\n }\n logLevel = level;\n\n const enabledNamespaces = [];\n for (const logger of registeredLoggers) {\n if (shouldEnable(logger)) {\n enabledNamespaces.push(logger.namespace);\n }\n }\n\n debug.enable(enabledNamespaces.join(\",\"));\n }\n\n if (logLevelFromEnv) {\n // avoid calling setLogLevel because we don't want a mis-set environment variable to crash\n if (isTypeSpecRuntimeLogLevel(logLevelFromEnv)) {\n contextSetLogLevel(logLevelFromEnv);\n } else {\n console.error(\n `${options.logLevelEnvVarName} set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${TYPESPEC_RUNTIME_LOG_LEVELS.join(\n \", \",\n )}.`,\n );\n }\n }\n\n function shouldEnable(logger: DebuggerWithLogLevel): boolean {\n return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]);\n }\n\n function createLogger(\n parent: TypeSpecRuntimeClientLogger,\n level: TypeSpecRuntimeLogLevel,\n ): DebuggerWithLogLevel {\n const logger: DebuggerWithLogLevel = Object.assign(parent.extend(level), {\n level,\n });\n\n patchLogMethod(parent, logger);\n\n if (shouldEnable(logger)) {\n const enabledNamespaces = debug.disable();\n debug.enable(enabledNamespaces + \",\" + logger.namespace);\n }\n\n registeredLoggers.add(logger);\n\n return logger;\n }\n\n function contextGetLogLevel(): TypeSpecRuntimeLogLevel | undefined {\n return logLevel;\n }\n\n function contextCreateClientLogger(namespace: string): TypeSpecRuntimeLogger {\n const clientRootLogger: TypeSpecRuntimeClientLogger = clientLogger.extend(namespace);\n patchLogMethod(clientLogger, clientRootLogger);\n return {\n error: createLogger(clientRootLogger, \"error\"),\n warning: createLogger(clientRootLogger, \"warning\"),\n info: createLogger(clientRootLogger, \"info\"),\n verbose: createLogger(clientRootLogger, \"verbose\"),\n };\n }\n\n return {\n setLogLevel: contextSetLogLevel,\n getLogLevel: contextGetLogLevel,\n createClientLogger: contextCreateClientLogger,\n logger: clientLogger,\n };\n}\n\nconst context = createLoggerContext({\n logLevelEnvVarName: \"TYPESPEC_RUNTIME_LOG_LEVEL\",\n namespace: \"typeSpecRuntime\",\n});\n\n/**\n * Immediately enables logging at the specified log level. If no level is specified, logging is disabled.\n * @param level - The log level to enable for logging.\n * Options from most verbose to least verbose are:\n * - verbose\n * - info\n * - warning\n * - error\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const TypeSpecRuntimeLogger: TypeSpecRuntimeClientLogger = context.logger;\n\n/**\n * Retrieves the currently specified log level.\n */\nexport function setLogLevel(logLevel?: TypeSpecRuntimeLogLevel): void {\n context.setLogLevel(logLevel);\n}\n\n/**\n * Retrieves the currently specified log level.\n */\nexport function getLogLevel(): TypeSpecRuntimeLogLevel | undefined {\n return context.getLogLevel();\n}\n\n/**\n * Creates a logger for use by the SDKs that inherits from `TypeSpecRuntimeLogger`.\n * @param namespace - The name of the SDK package.\n * @hidden\n */\nexport function createClientLogger(namespace: string): TypeSpecRuntimeLogger {\n return context.createClientLogger(namespace);\n}\n"]}
@@ -208,7 +208,9 @@ class NodeHttpClient {
208
208
  req.end(body);
209
209
  }
210
210
  else if (isArrayBuffer(body)) {
211
- req.end(ArrayBuffer.isView(body) ? Buffer.from(body.buffer) : Buffer.from(body));
211
+ req.end(ArrayBuffer.isView(body)
212
+ ? Buffer.from(body.buffer, body.byteOffset, body.byteLength)
213
+ : Buffer.from(body));
212
214
  }
213
215
  else {
214
216
  logger.error("Unrecognized body type", body);
@@ -1 +1 @@
1
- {"version":3,"file":"nodeHttpClient.js","sourceRoot":"","sources":["../../src/nodeHttpClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAU9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,SAAS,gBAAgB,CAAC,IAAS;IACjC,OAAO,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC;AACjD,CAAC;AAED,SAAS,gBAAgB,CAAC,MAA6B;IACrD,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,OAAO,GAAG,GAAS,EAAE;YACzB,OAAO,EAAE,CAAC;YACV,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACxC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YACtC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,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M,CAAC;gBACN,MAAM,CACJ,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC,OAAO,EAAE,EAAE;oBAC5D,IAAI,EAAE,SAAS,CAAC,WAAW;iBAC5B,CAAC,CACH,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,aAAa,CAAC,IAAqB;IACjD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,CAAC,CAAC;IACX,CAAC;SAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;SAAM,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IAClC,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,cAAc,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport http from \"node:http\";\nimport https from \"node:https\";\nimport zlib from \"node:zlib\";\nimport { Transform } from \"node:stream\";\nimport { AbortError } from \"./abort-controller/AbortError.js\";\nimport type {\n HttpClient,\n HttpHeaders,\n PipelineRequest,\n PipelineResponse,\n RequestBodyType,\n TlsSettings,\n TransferProgressEvent,\n} from \"./interfaces.js\";\nimport { createHttpHeaders } from \"./httpHeaders.js\";\nimport { RestError } from \"./restError.js\";\nimport type { IncomingMessage } from \"node:http\";\nimport { logger } from \"./log.js\";\nimport { Sanitizer } from \"./util/sanitizer.js\";\n\nconst DEFAULT_TLS_SETTINGS = {};\n\nfunction isReadableStream(body: any): body is NodeJS.ReadableStream {\n return body && typeof body.pipe === \"function\";\n}\n\nfunction isStreamComplete(stream: NodeJS.ReadableStream): Promise<void> {\n if (stream.readable === false) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n const handler = (): void => {\n resolve();\n stream.removeListener(\"close\", handler);\n stream.removeListener(\"end\", handler);\n stream.removeListener(\"error\", handler);\n };\n\n stream.on(\"close\", handler);\n stream.on(\"end\", handler);\n stream.on(\"error\", handler);\n });\n}\n\nfunction isArrayBuffer(body: any): body is ArrayBuffer | ArrayBufferView {\n return body && typeof body.byteLength === \"number\";\n}\n\nclass ReportTransform extends Transform {\n private loadedBytes = 0;\n private progressCallback: (progress: TransferProgressEvent) => void;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n _transform(chunk: string | Buffer, _encoding: string, callback: Function): void {\n this.push(chunk);\n this.loadedBytes += chunk.length;\n try {\n this.progressCallback({ loadedBytes: this.loadedBytes });\n callback();\n } catch (e: any) {\n callback(e);\n }\n }\n\n constructor(progressCallback: (progress: TransferProgressEvent) => void) {\n super();\n this.progressCallback = progressCallback;\n }\n}\n\n/**\n * A HttpClient implementation that uses Node's \"https\" module to send HTTPS requests.\n * @internal\n */\nclass NodeHttpClient implements HttpClient {\n private cachedHttpAgent?: http.Agent;\n private cachedHttpsAgents: WeakMap<TlsSettings, https.Agent> = new WeakMap();\n\n /**\n * Makes a request over an underlying transport layer and returns the response.\n * @param request - The request to be made.\n */\n public async sendRequest(request: PipelineRequest): Promise<PipelineResponse> {\n const abortController = new AbortController();\n let abortListener: ((event: any) => void) | undefined;\n if (request.abortSignal) {\n if (request.abortSignal.aborted) {\n throw new AbortError(\"The operation was aborted. Request has already been canceled.\");\n }\n\n abortListener = (event: Event) => {\n if (event.type === \"abort\") {\n abortController.abort();\n }\n };\n request.abortSignal.addEventListener(\"abort\", abortListener);\n }\n\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n if (request.timeout > 0) {\n timeoutId = setTimeout(() => {\n const sanitizer = new Sanitizer();\n logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`);\n abortController.abort();\n }, request.timeout);\n }\n\n const acceptEncoding = request.headers.get(\"Accept-Encoding\");\n const shouldDecompress =\n acceptEncoding?.includes(\"gzip\") || acceptEncoding?.includes(\"deflate\");\n\n let body = typeof request.body === \"function\" ? request.body() : request.body;\n if (body && !request.headers.has(\"Content-Length\")) {\n const bodyLength = getBodyLength(body);\n if (bodyLength !== null) {\n request.headers.set(\"Content-Length\", bodyLength);\n }\n }\n\n let responseStream: NodeJS.ReadableStream | undefined;\n try {\n if (body && request.onUploadProgress) {\n const onUploadProgress = request.onUploadProgress;\n const uploadReportStream = new ReportTransform(onUploadProgress);\n uploadReportStream.on(\"error\", (e) => {\n logger.error(\"Error in upload progress\", e);\n });\n if (isReadableStream(body)) {\n body.pipe(uploadReportStream);\n } else {\n uploadReportStream.end(body);\n }\n\n body = uploadReportStream;\n }\n\n const res = await this.makeRequest(request, abortController, body);\n\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n }\n\n const headers = getResponseHeaders(res);\n\n const status = res.statusCode ?? 0;\n const response: PipelineResponse = {\n status,\n headers,\n request,\n };\n\n // Responses to HEAD must not have a body.\n // If they do return a body, that body must be ignored.\n if (request.method === \"HEAD\") {\n // call resume() and not destroy() to avoid closing the socket\n // and losing keep alive\n res.resume();\n return response;\n }\n\n responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res;\n\n const onDownloadProgress = request.onDownloadProgress;\n if (onDownloadProgress) {\n const downloadReportStream = new ReportTransform(onDownloadProgress);\n downloadReportStream.on(\"error\", (e) => {\n logger.error(\"Error in download progress\", e);\n });\n responseStream.pipe(downloadReportStream);\n responseStream = downloadReportStream;\n }\n\n if (\n // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code\n request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) ||\n request.streamResponseStatusCodes?.has(response.status)\n ) {\n response.readableStreamBody = responseStream;\n } else {\n response.bodyAsText = await streamToText(responseStream);\n }\n\n return response;\n } finally {\n // clean up event listener\n if (request.abortSignal && abortListener) {\n let uploadStreamDone = Promise.resolve();\n if (isReadableStream(body)) {\n uploadStreamDone = isStreamComplete(body);\n }\n let downloadStreamDone = Promise.resolve();\n if (isReadableStream(responseStream)) {\n downloadStreamDone = isStreamComplete(responseStream);\n }\n Promise.all([uploadStreamDone, downloadStreamDone])\n .then(() => {\n // eslint-disable-next-line promise/always-return\n if (abortListener) {\n request.abortSignal?.removeEventListener(\"abort\", abortListener);\n }\n })\n .catch((e) => {\n logger.warning(\"Error when cleaning up abortListener on httpRequest\", e);\n });\n }\n }\n }\n\n private makeRequest(\n request: PipelineRequest,\n abortController: AbortController,\n body?: RequestBodyType,\n ): Promise<http.IncomingMessage> {\n const url = new URL(request.url);\n\n const isInsecure = url.protocol !== \"https:\";\n\n if (isInsecure && !request.allowInsecureConnection) {\n throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`);\n }\n\n const agent = (request.agent as http.Agent) ?? this.getOrCreateAgent(request, isInsecure);\n const options: http.RequestOptions = {\n agent,\n hostname: url.hostname,\n path: `${url.pathname}${url.search}`,\n port: url.port,\n method: request.method,\n headers: request.headers.toJSON({ preserveCase: true }),\n ...request.requestOverrides,\n };\n\n return new Promise<http.IncomingMessage>((resolve, reject) => {\n const req = isInsecure ? http.request(options, resolve) : https.request(options, resolve);\n\n req.once(\"error\", (err: Error & { code?: string }) => {\n reject(\n new RestError(err.message, { code: err.code ?? RestError.REQUEST_SEND_ERROR, request }),\n );\n });\n\n abortController.signal.addEventListener(\"abort\", () => {\n const abortError = new AbortError(\n \"The operation was aborted. Rejecting from abort signal callback while making request.\",\n );\n req.destroy(abortError);\n reject(abortError);\n });\n if (body && isReadableStream(body)) {\n body.pipe(req);\n } else if (body) {\n if (typeof body === \"string\" || Buffer.isBuffer(body)) {\n req.end(body);\n } else if (isArrayBuffer(body)) {\n req.end(ArrayBuffer.isView(body) ? Buffer.from(body.buffer) : Buffer.from(body));\n } else {\n logger.error(\"Unrecognized body type\", body);\n reject(new RestError(\"Unrecognized body type\"));\n }\n } else {\n // streams don't like \"undefined\" being passed as data\n req.end();\n }\n });\n }\n\n private getOrCreateAgent(request: PipelineRequest, isInsecure: boolean): http.Agent {\n const disableKeepAlive = request.disableKeepAlive;\n\n // Handle Insecure requests first\n if (isInsecure) {\n if (disableKeepAlive) {\n // keepAlive:false is the default so we don't need a custom Agent\n return http.globalAgent;\n }\n\n if (!this.cachedHttpAgent) {\n // If there is no cached agent create a new one and cache it.\n this.cachedHttpAgent = new http.Agent({ keepAlive: true });\n }\n return this.cachedHttpAgent;\n } else {\n if (disableKeepAlive && !request.tlsSettings) {\n // When there are no tlsSettings and keepAlive is false\n // we don't need a custom agent\n return https.globalAgent;\n }\n\n // We use the tlsSettings to index cached clients\n const tlsSettings = request.tlsSettings ?? DEFAULT_TLS_SETTINGS;\n\n // Get the cached agent or create a new one with the\n // provided values for keepAlive and tlsSettings\n let agent = this.cachedHttpsAgents.get(tlsSettings);\n\n if (agent && agent.options.keepAlive === !disableKeepAlive) {\n return agent;\n }\n\n logger.info(\"No cached TLS Agent exist, creating a new Agent\");\n agent = new https.Agent({\n // keepAlive is true if disableKeepAlive is false.\n keepAlive: !disableKeepAlive,\n // Since we are spreading, if no tslSettings were provided, nothing is added to the agent options.\n ...tlsSettings,\n });\n\n this.cachedHttpsAgents.set(tlsSettings, agent);\n return agent;\n }\n }\n}\n\nfunction getResponseHeaders(res: IncomingMessage): HttpHeaders {\n const headers = createHttpHeaders();\n for (const header of Object.keys(res.headers)) {\n const value = res.headers[header];\n if (Array.isArray(value)) {\n if (value.length > 0) {\n headers.set(header, value[0]);\n }\n } else if (value) {\n headers.set(header, value);\n }\n }\n return headers;\n}\n\nfunction getDecodedResponseStream(\n stream: IncomingMessage,\n headers: HttpHeaders,\n): NodeJS.ReadableStream {\n const contentEncoding = headers.get(\"Content-Encoding\");\n if (contentEncoding === \"gzip\") {\n const unzip = zlib.createGunzip();\n stream.pipe(unzip);\n return unzip;\n } else if (contentEncoding === \"deflate\") {\n const inflate = zlib.createInflate();\n stream.pipe(inflate);\n return inflate;\n }\n\n return stream;\n}\n\nfunction streamToText(stream: NodeJS.ReadableStream): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const buffer: Buffer[] = [];\n\n stream.on(\"data\", (chunk) => {\n if (Buffer.isBuffer(chunk)) {\n buffer.push(chunk);\n } else {\n buffer.push(Buffer.from(chunk));\n }\n });\n stream.on(\"end\", () => {\n resolve(Buffer.concat(buffer).toString(\"utf8\"));\n });\n stream.on(\"error\", (e) => {\n if (e && e?.name === \"AbortError\") {\n reject(e);\n } else {\n reject(\n new RestError(`Error reading response as text: ${e.message}`, {\n code: RestError.PARSE_ERROR,\n }),\n );\n }\n });\n });\n}\n\n/** @internal */\nexport function getBodyLength(body: RequestBodyType): number | null {\n if (!body) {\n return 0;\n } else if (Buffer.isBuffer(body)) {\n return body.length;\n } else if (isReadableStream(body)) {\n return null;\n } else if (isArrayBuffer(body)) {\n return body.byteLength;\n } else if (typeof body === \"string\") {\n return Buffer.from(body).length;\n } else {\n return null;\n }\n}\n\n/**\n * Create a new HttpClient instance for the NodeJS environment.\n * @internal\n */\nexport function createNodeHttpClient(): HttpClient {\n return new NodeHttpClient();\n}\n"]}
1
+ {"version":3,"file":"nodeHttpClient.js","sourceRoot":"","sources":["../../src/nodeHttpClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAA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,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;SAAM,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IAClC,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,cAAc,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport http from \"node:http\";\nimport https from \"node:https\";\nimport zlib from \"node:zlib\";\nimport { Transform } from \"node:stream\";\nimport { AbortError } from \"./abort-controller/AbortError.js\";\nimport type {\n HttpClient,\n HttpHeaders,\n PipelineRequest,\n PipelineResponse,\n RequestBodyType,\n TlsSettings,\n TransferProgressEvent,\n} from \"./interfaces.js\";\nimport { createHttpHeaders } from \"./httpHeaders.js\";\nimport { RestError } from \"./restError.js\";\nimport type { IncomingMessage } from \"node:http\";\nimport { logger } from \"./log.js\";\nimport { Sanitizer } from \"./util/sanitizer.js\";\n\nconst DEFAULT_TLS_SETTINGS = {};\n\nfunction isReadableStream(body: any): body is NodeJS.ReadableStream {\n return body && typeof body.pipe === \"function\";\n}\n\nfunction isStreamComplete(stream: NodeJS.ReadableStream): Promise<void> {\n if (stream.readable === false) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n const handler = (): void => {\n resolve();\n stream.removeListener(\"close\", handler);\n stream.removeListener(\"end\", handler);\n stream.removeListener(\"error\", handler);\n };\n\n stream.on(\"close\", handler);\n stream.on(\"end\", handler);\n stream.on(\"error\", handler);\n });\n}\n\nfunction isArrayBuffer(body: any): body is ArrayBuffer | ArrayBufferView {\n return body && typeof body.byteLength === \"number\";\n}\n\nclass ReportTransform extends Transform {\n private loadedBytes = 0;\n private progressCallback: (progress: TransferProgressEvent) => void;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n _transform(chunk: string | Buffer, _encoding: string, callback: Function): void {\n this.push(chunk);\n this.loadedBytes += chunk.length;\n try {\n this.progressCallback({ loadedBytes: this.loadedBytes });\n callback();\n } catch (e: any) {\n callback(e);\n }\n }\n\n constructor(progressCallback: (progress: TransferProgressEvent) => void) {\n super();\n this.progressCallback = progressCallback;\n }\n}\n\n/**\n * A HttpClient implementation that uses Node's \"https\" module to send HTTPS requests.\n * @internal\n */\nclass NodeHttpClient implements HttpClient {\n private cachedHttpAgent?: http.Agent;\n private cachedHttpsAgents: WeakMap<TlsSettings, https.Agent> = new WeakMap();\n\n /**\n * Makes a request over an underlying transport layer and returns the response.\n * @param request - The request to be made.\n */\n public async sendRequest(request: PipelineRequest): Promise<PipelineResponse> {\n const abortController = new AbortController();\n let abortListener: ((event: any) => void) | undefined;\n if (request.abortSignal) {\n if (request.abortSignal.aborted) {\n throw new AbortError(\"The operation was aborted. Request has already been canceled.\");\n }\n\n abortListener = (event: Event) => {\n if (event.type === \"abort\") {\n abortController.abort();\n }\n };\n request.abortSignal.addEventListener(\"abort\", abortListener);\n }\n\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n if (request.timeout > 0) {\n timeoutId = setTimeout(() => {\n const sanitizer = new Sanitizer();\n logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`);\n abortController.abort();\n }, request.timeout);\n }\n\n const acceptEncoding = request.headers.get(\"Accept-Encoding\");\n const shouldDecompress =\n acceptEncoding?.includes(\"gzip\") || acceptEncoding?.includes(\"deflate\");\n\n let body = typeof request.body === \"function\" ? request.body() : request.body;\n if (body && !request.headers.has(\"Content-Length\")) {\n const bodyLength = getBodyLength(body);\n if (bodyLength !== null) {\n request.headers.set(\"Content-Length\", bodyLength);\n }\n }\n\n let responseStream: NodeJS.ReadableStream | undefined;\n try {\n if (body && request.onUploadProgress) {\n const onUploadProgress = request.onUploadProgress;\n const uploadReportStream = new ReportTransform(onUploadProgress);\n uploadReportStream.on(\"error\", (e) => {\n logger.error(\"Error in upload progress\", e);\n });\n if (isReadableStream(body)) {\n body.pipe(uploadReportStream);\n } else {\n uploadReportStream.end(body);\n }\n\n body = uploadReportStream;\n }\n\n const res = await this.makeRequest(request, abortController, body);\n\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n }\n\n const headers = getResponseHeaders(res);\n\n const status = res.statusCode ?? 0;\n const response: PipelineResponse = {\n status,\n headers,\n request,\n };\n\n // Responses to HEAD must not have a body.\n // If they do return a body, that body must be ignored.\n if (request.method === \"HEAD\") {\n // call resume() and not destroy() to avoid closing the socket\n // and losing keep alive\n res.resume();\n return response;\n }\n\n responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res;\n\n const onDownloadProgress = request.onDownloadProgress;\n if (onDownloadProgress) {\n const downloadReportStream = new ReportTransform(onDownloadProgress);\n downloadReportStream.on(\"error\", (e) => {\n logger.error(\"Error in download progress\", e);\n });\n responseStream.pipe(downloadReportStream);\n responseStream = downloadReportStream;\n }\n\n if (\n // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code\n request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) ||\n request.streamResponseStatusCodes?.has(response.status)\n ) {\n response.readableStreamBody = responseStream;\n } else {\n response.bodyAsText = await streamToText(responseStream);\n }\n\n return response;\n } finally {\n // clean up event listener\n if (request.abortSignal && abortListener) {\n let uploadStreamDone = Promise.resolve();\n if (isReadableStream(body)) {\n uploadStreamDone = isStreamComplete(body);\n }\n let downloadStreamDone = Promise.resolve();\n if (isReadableStream(responseStream)) {\n downloadStreamDone = isStreamComplete(responseStream);\n }\n Promise.all([uploadStreamDone, downloadStreamDone])\n .then(() => {\n // eslint-disable-next-line promise/always-return\n if (abortListener) {\n request.abortSignal?.removeEventListener(\"abort\", abortListener);\n }\n })\n .catch((e) => {\n logger.warning(\"Error when cleaning up abortListener on httpRequest\", e);\n });\n }\n }\n }\n\n private makeRequest(\n request: PipelineRequest,\n abortController: AbortController,\n body?: RequestBodyType,\n ): Promise<http.IncomingMessage> {\n const url = new URL(request.url);\n\n const isInsecure = url.protocol !== \"https:\";\n\n if (isInsecure && !request.allowInsecureConnection) {\n throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`);\n }\n\n const agent = (request.agent as http.Agent) ?? this.getOrCreateAgent(request, isInsecure);\n const options: http.RequestOptions = {\n agent,\n hostname: url.hostname,\n path: `${url.pathname}${url.search}`,\n port: url.port,\n method: request.method,\n headers: request.headers.toJSON({ preserveCase: true }),\n ...request.requestOverrides,\n };\n\n return new Promise<http.IncomingMessage>((resolve, reject) => {\n const req = isInsecure ? http.request(options, resolve) : https.request(options, resolve);\n\n req.once(\"error\", (err: Error & { code?: string }) => {\n reject(\n new RestError(err.message, { code: err.code ?? RestError.REQUEST_SEND_ERROR, request }),\n );\n });\n\n abortController.signal.addEventListener(\"abort\", () => {\n const abortError = new AbortError(\n \"The operation was aborted. Rejecting from abort signal callback while making request.\",\n );\n req.destroy(abortError);\n reject(abortError);\n });\n if (body && isReadableStream(body)) {\n body.pipe(req);\n } else if (body) {\n if (typeof body === \"string\" || Buffer.isBuffer(body)) {\n req.end(body);\n } else if (isArrayBuffer(body)) {\n req.end(\n ArrayBuffer.isView(body)\n ? Buffer.from(body.buffer, body.byteOffset, body.byteLength)\n : Buffer.from(body),\n );\n } else {\n logger.error(\"Unrecognized body type\", body);\n reject(new RestError(\"Unrecognized body type\"));\n }\n } else {\n // streams don't like \"undefined\" being passed as data\n req.end();\n }\n });\n }\n\n private getOrCreateAgent(request: PipelineRequest, isInsecure: boolean): http.Agent {\n const disableKeepAlive = request.disableKeepAlive;\n\n // Handle Insecure requests first\n if (isInsecure) {\n if (disableKeepAlive) {\n // keepAlive:false is the default so we don't need a custom Agent\n return http.globalAgent;\n }\n\n if (!this.cachedHttpAgent) {\n // If there is no cached agent create a new one and cache it.\n this.cachedHttpAgent = new http.Agent({ keepAlive: true });\n }\n return this.cachedHttpAgent;\n } else {\n if (disableKeepAlive && !request.tlsSettings) {\n // When there are no tlsSettings and keepAlive is false\n // we don't need a custom agent\n return https.globalAgent;\n }\n\n // We use the tlsSettings to index cached clients\n const tlsSettings = request.tlsSettings ?? DEFAULT_TLS_SETTINGS;\n\n // Get the cached agent or create a new one with the\n // provided values for keepAlive and tlsSettings\n let agent = this.cachedHttpsAgents.get(tlsSettings);\n\n if (agent && agent.options.keepAlive === !disableKeepAlive) {\n return agent;\n }\n\n logger.info(\"No cached TLS Agent exist, creating a new Agent\");\n agent = new https.Agent({\n // keepAlive is true if disableKeepAlive is false.\n keepAlive: !disableKeepAlive,\n // Since we are spreading, if no tslSettings were provided, nothing is added to the agent options.\n ...tlsSettings,\n });\n\n this.cachedHttpsAgents.set(tlsSettings, agent);\n return agent;\n }\n }\n}\n\nfunction getResponseHeaders(res: IncomingMessage): HttpHeaders {\n const headers = createHttpHeaders();\n for (const header of Object.keys(res.headers)) {\n const value = res.headers[header];\n if (Array.isArray(value)) {\n if (value.length > 0) {\n headers.set(header, value[0]);\n }\n } else if (value) {\n headers.set(header, value);\n }\n }\n return headers;\n}\n\nfunction getDecodedResponseStream(\n stream: IncomingMessage,\n headers: HttpHeaders,\n): NodeJS.ReadableStream {\n const contentEncoding = headers.get(\"Content-Encoding\");\n if (contentEncoding === \"gzip\") {\n const unzip = zlib.createGunzip();\n stream.pipe(unzip);\n return unzip;\n } else if (contentEncoding === \"deflate\") {\n const inflate = zlib.createInflate();\n stream.pipe(inflate);\n return inflate;\n }\n\n return stream;\n}\n\nfunction streamToText(stream: NodeJS.ReadableStream): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const buffer: Buffer[] = [];\n\n stream.on(\"data\", (chunk) => {\n if (Buffer.isBuffer(chunk)) {\n buffer.push(chunk);\n } else {\n buffer.push(Buffer.from(chunk));\n }\n });\n stream.on(\"end\", () => {\n resolve(Buffer.concat(buffer).toString(\"utf8\"));\n });\n stream.on(\"error\", (e) => {\n if (e && e?.name === \"AbortError\") {\n reject(e);\n } else {\n reject(\n new RestError(`Error reading response as text: ${e.message}`, {\n code: RestError.PARSE_ERROR,\n }),\n );\n }\n });\n });\n}\n\n/** @internal */\nexport function getBodyLength(body: RequestBodyType): number | null {\n if (!body) {\n return 0;\n } else if (Buffer.isBuffer(body)) {\n return body.length;\n } else if (isReadableStream(body)) {\n return null;\n } else if (isArrayBuffer(body)) {\n return body.byteLength;\n } else if (typeof body === \"string\") {\n return Buffer.from(body).length;\n } else {\n return null;\n }\n}\n\n/**\n * Create a new HttpClient instance for the NodeJS environment.\n * @internal\n */\nexport function createNodeHttpClient(): HttpClient {\n return new NodeHttpClient();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"pipelineRequest.js","sourceRoot":"","sources":["../../src/pipelineRequest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAYlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAyHjD,MAAM,mBAAmB;IAChB,GAAG,CAAS;IACZ,MAAM,CAAc;IACpB,OAAO,CAAc;IACrB,OAAO,CAAS;IAChB,eAAe,CAAU;IACzB,IAAI,CAAmB;IACvB,aAAa,CAAwB;IACrC,QAAQ,CAAe;IACvB,yBAAyB,CAAe;IACxC,oBAAoB,CAAU;IAE9B,aAAa,CAAiB;IAC9B,gBAAgB,CAAU;IAC1B,WAAW,CAAe;IAC1B,SAAS,CAAS;IAClB,uBAAuB,CAAW;IAClC,gBAAgB,CAA6C;IAC7D,kBAAkB,CAA6C;IAC/D,gBAAgB,CAA2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;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA+B;IACnE,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FormDataMap,\n HttpHeaders,\n HttpMethods,\n MultipartRequestBody,\n PipelineRequest,\n ProxySettings,\n RequestBodyType,\n TransferProgressEvent,\n} from \"./interfaces.js\";\nimport { createHttpHeaders } from \"./httpHeaders.js\";\nimport { randomUUID } from \"./util/uuidUtils.js\";\nimport type { AuthScheme } from \"./auth/schemes.js\";\n\n/**\n * Settings to initialize a request.\n * Almost equivalent to Partial<PipelineRequest>, but url is mandatory.\n */\nexport interface PipelineRequestOptions {\n /**\n * The URL to make the request to.\n */\n url: string;\n\n /**\n * The HTTP method to use when making the request.\n */\n method?: HttpMethods;\n\n /**\n * The HTTP headers to use when making the request.\n */\n headers?: HttpHeaders;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n * If the request is terminated, an `AbortError` is thrown.\n * Defaults to 0, which disables the timeout.\n */\n timeout?: number;\n\n /**\n * If credentials (cookies) should be sent along during an XHR.\n * Defaults to false.\n */\n withCredentials?: boolean;\n\n /**\n * A unique identifier for the request. Used for logging and tracing.\n */\n requestId?: string;\n\n /**\n * The HTTP body content (if any)\n */\n body?: RequestBodyType;\n\n /**\n * Body for a multipart request.\n */\n multipartBody?: MultipartRequestBody;\n\n /**\n * To simulate a browser form post\n */\n formData?: FormDataMap;\n\n /**\n * A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.\n */\n streamResponseStatusCodes?: Set<number>;\n\n /**\n * BROWSER ONLY\n *\n * A browser only option to enable use of the Streams API. If this option is set and streaming is used\n * (see `streamResponseStatusCodes`), the response will have a property `browserStream` instead of\n * `blobBody` which will be undefined.\n *\n * Default value is false\n */\n enableBrowserStreams?: boolean;\n\n /**\n * Proxy configuration.\n */\n proxySettings?: ProxySettings;\n\n /**\n * If the connection should not be reused.\n */\n disableKeepAlive?: boolean;\n\n /**\n * Used to abort the request later.\n */\n abortSignal?: AbortSignal;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /** Callback which fires upon download progress. */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n\n /**\n * List of authentication schemes used for this specific request.\n * These schemes define how the request will be authenticated.\n *\n * If values are provided, these schemes override the client level authentication schemes.\n * If an empty array is provided, it explicitly specifies no authentication for the request.\n * If not provided at the request level, the client level authentication schemes will be used.\n */\n authSchemes?: AuthScheme[];\n\n /**\n * Additional options to set on the request. This provides a way to override\n * existing ones or provide request properties that are not declared.\n *\n * For possible valid properties, see\n * - NodeJS https.request options: https://nodejs.org/api/http.html#httprequestoptions-callback\n * - Browser RequestInit: https://developer.mozilla.org/en-US/docs/Web/API/RequestInit\n *\n * WARNING: Options specified here will override any properties of same names when request is sent by {@link HttpClient}.\n */\n requestOverrides?: Record<string, unknown>;\n}\n\nclass PipelineRequestImpl implements PipelineRequest {\n public url: string;\n public method: HttpMethods;\n public headers: HttpHeaders;\n public timeout: number;\n public withCredentials: boolean;\n public body?: RequestBodyType;\n public multipartBody?: MultipartRequestBody;\n public formData?: FormDataMap;\n public streamResponseStatusCodes?: Set<number>;\n public enableBrowserStreams: boolean;\n\n public proxySettings?: ProxySettings;\n public disableKeepAlive: boolean;\n public abortSignal?: AbortSignal;\n public requestId: string;\n public allowInsecureConnection?: boolean;\n public onUploadProgress?: (progress: TransferProgressEvent) => void;\n public onDownloadProgress?: (progress: TransferProgressEvent) => void;\n public requestOverrides?: Record<string, unknown>;\n public authSchemes?: AuthScheme[];\n\n constructor(options: PipelineRequestOptions) {\n this.url = options.url;\n this.body = options.body;\n this.headers = options.headers ?? createHttpHeaders();\n this.method = options.method ?? \"GET\";\n this.timeout = options.timeout ?? 0;\n this.multipartBody = options.multipartBody;\n this.formData = options.formData;\n this.disableKeepAlive = options.disableKeepAlive ?? false;\n this.proxySettings = options.proxySettings;\n this.streamResponseStatusCodes = options.streamResponseStatusCodes;\n this.withCredentials = options.withCredentials ?? false;\n this.abortSignal = options.abortSignal;\n this.onUploadProgress = options.onUploadProgress;\n this.onDownloadProgress = options.onDownloadProgress;\n this.requestId = options.requestId || randomUUID();\n this.allowInsecureConnection = options.allowInsecureConnection ?? false;\n this.enableBrowserStreams = options.enableBrowserStreams ?? false;\n this.requestOverrides = options.requestOverrides;\n this.authSchemes = options.authSchemes;\n }\n}\n\n/**\n * Creates a new pipeline request with the given options.\n * This method is to allow for the easy setting of default values and not required.\n * @param options - The options to create the request with.\n */\nexport function createPipelineRequest(options: PipelineRequestOptions): PipelineRequest {\n return new PipelineRequestImpl(options);\n}\n"]}
1
+ {"version":3,"file":"pipelineRequest.js","sourceRoot":"","sources":["../../src/pipelineRequest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAYlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAyH5C,MAAM,mBAAmB;IAChB,GAAG,CAAS;IACZ,MAAM,CAAc;IACpB,OAAO,CAAc;IACrB,OAAO,CAAS;IAChB,eAAe,CAAU;IACzB,IAAI,CAAmB;IACvB,aAAa,CAAwB;IACrC,QAAQ,CAAe;IACvB,yBAAyB,CAAe;IACxC,oBAAoB,CAAU;IAE9B,aAAa,CAAiB;IAC9B,gBAAgB,CAAU;IAC1B,WAAW,CAAe;IAC1B,SAAS,CAAS;IAClB,uBAAuB,CAAW;IAClC,gBAAgB,CAA6C;IAC7D,kBAAkB,CAA6C;IAC/D,gBAAgB,CAA2B;IAC3C,WAAW,CAAgB;IAElC,YAAY,OAA+B;QACzC,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,IAAI,G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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FormDataMap,\n HttpHeaders,\n HttpMethods,\n MultipartRequestBody,\n PipelineRequest,\n ProxySettings,\n RequestBodyType,\n TransferProgressEvent,\n} from \"./interfaces.js\";\nimport { createHttpHeaders } from \"./httpHeaders.js\";\nimport { randomUUID } from \"#platform/uuid\";\nimport type { AuthScheme } from \"./auth/schemes.js\";\n\n/**\n * Settings to initialize a request.\n * Almost equivalent to Partial<PipelineRequest>, but url is mandatory.\n */\nexport interface PipelineRequestOptions {\n /**\n * The URL to make the request to.\n */\n url: string;\n\n /**\n * The HTTP method to use when making the request.\n */\n method?: HttpMethods;\n\n /**\n * The HTTP headers to use when making the request.\n */\n headers?: HttpHeaders;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n * If the request is terminated, an `AbortError` is thrown.\n * Defaults to 0, which disables the timeout.\n */\n timeout?: number;\n\n /**\n * If credentials (cookies) should be sent along during an XHR.\n * Defaults to false.\n */\n withCredentials?: boolean;\n\n /**\n * A unique identifier for the request. Used for logging and tracing.\n */\n requestId?: string;\n\n /**\n * The HTTP body content (if any)\n */\n body?: RequestBodyType;\n\n /**\n * Body for a multipart request.\n */\n multipartBody?: MultipartRequestBody;\n\n /**\n * To simulate a browser form post\n */\n formData?: FormDataMap;\n\n /**\n * A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.\n */\n streamResponseStatusCodes?: Set<number>;\n\n /**\n * BROWSER ONLY\n *\n * A browser only option to enable use of the Streams API. If this option is set and streaming is used\n * (see `streamResponseStatusCodes`), the response will have a property `browserStream` instead of\n * `blobBody` which will be undefined.\n *\n * Default value is false\n */\n enableBrowserStreams?: boolean;\n\n /**\n * Proxy configuration.\n */\n proxySettings?: ProxySettings;\n\n /**\n * If the connection should not be reused.\n */\n disableKeepAlive?: boolean;\n\n /**\n * Used to abort the request later.\n */\n abortSignal?: AbortSignal;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /** Callback which fires upon download progress. */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n\n /**\n * List of authentication schemes used for this specific request.\n * These schemes define how the request will be authenticated.\n *\n * If values are provided, these schemes override the client level authentication schemes.\n * If an empty array is provided, it explicitly specifies no authentication for the request.\n * If not provided at the request level, the client level authentication schemes will be used.\n */\n authSchemes?: AuthScheme[];\n\n /**\n * Additional options to set on the request. This provides a way to override\n * existing ones or provide request properties that are not declared.\n *\n * For possible valid properties, see\n * - NodeJS https.request options: https://nodejs.org/api/http.html#httprequestoptions-callback\n * - Browser RequestInit: https://developer.mozilla.org/en-US/docs/Web/API/RequestInit\n *\n * WARNING: Options specified here will override any properties of same names when request is sent by {@link HttpClient}.\n */\n requestOverrides?: Record<string, unknown>;\n}\n\nclass PipelineRequestImpl implements PipelineRequest {\n public url: string;\n public method: HttpMethods;\n public headers: HttpHeaders;\n public timeout: number;\n public withCredentials: boolean;\n public body?: RequestBodyType;\n public multipartBody?: MultipartRequestBody;\n public formData?: FormDataMap;\n public streamResponseStatusCodes?: Set<number>;\n public enableBrowserStreams: boolean;\n\n public proxySettings?: ProxySettings;\n public disableKeepAlive: boolean;\n public abortSignal?: AbortSignal;\n public requestId: string;\n public allowInsecureConnection?: boolean;\n public onUploadProgress?: (progress: TransferProgressEvent) => void;\n public onDownloadProgress?: (progress: TransferProgressEvent) => void;\n public requestOverrides?: Record<string, unknown>;\n public authSchemes?: AuthScheme[];\n\n constructor(options: PipelineRequestOptions) {\n this.url = options.url;\n this.body = options.body;\n this.headers = options.headers ?? createHttpHeaders();\n this.method = options.method ?? \"GET\";\n this.timeout = options.timeout ?? 0;\n this.multipartBody = options.multipartBody;\n this.formData = options.formData;\n this.disableKeepAlive = options.disableKeepAlive ?? false;\n this.proxySettings = options.proxySettings;\n this.streamResponseStatusCodes = options.streamResponseStatusCodes;\n this.withCredentials = options.withCredentials ?? false;\n this.abortSignal = options.abortSignal;\n this.onUploadProgress = options.onUploadProgress;\n this.onDownloadProgress = options.onDownloadProgress;\n this.requestId = options.requestId || randomUUID();\n this.allowInsecureConnection = options.allowInsecureConnection ?? false;\n this.enableBrowserStreams = options.enableBrowserStreams ?? false;\n this.requestOverrides = options.requestOverrides;\n this.authSchemes = options.authSchemes;\n }\n}\n\n/**\n * Creates a new pipeline request with the given options.\n * This method is to allow for the easy setting of default values and not required.\n * @param options - The options to create the request with.\n */\nexport function createPipelineRequest(options: PipelineRequestOptions): PipelineRequest {\n return new PipelineRequestImpl(options);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"basicAuthenticationPolicy.js","sourceRoot":"","sources":["../../../../src/policies/auth/basicAuthenticationPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,4BAA4B,CAAC;AAqB1E;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAyC;IAEzC,OAAO;QACL,IAAI,EAAE,6BAA6B;QACnC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,0FAA0F;YAC1F,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAEzC,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,CAC/D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,OAAO,CACjD,CAAC;YAEF,+EAA+E;YAC/E,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;YAED,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAClD,MAAM,WAAW,GAAG,kBAAkB,CACpC,kBAAkB,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,EAAE,OAAO,CAAC,EACtD,QAAQ,CACT,CAAC;YACF,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,SAAS,WAAW,EAAE,CAAC,CAAC;YAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { BasicCredential } from \"../../auth/credentials.js\";\nimport type { AuthScheme } from \"../../auth/schemes.js\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"../../interfaces.js\";\nimport type { PipelinePolicy } from \"../../pipeline.js\";\nimport { stringToUint8Array, uint8ArrayToString } from \"../../util/bytesEncoding.js\";\nimport { ensureSecureConnection } from \"./checkInsecureConnection.js\";\n\n/**\n * Name of the Basic Authentication Policy\n */\nexport const basicAuthenticationPolicyName = \"bearerAuthenticationPolicy\";\n\n/**\n * Options for configuring the basic authentication policy\n */\nexport interface BasicAuthenticationPolicyOptions {\n /**\n * The credential used to authenticate requests\n */\n credential: BasicCredential;\n /**\n * Optional authentication schemes to use. If not provided, schemes from the request will be used.\n */\n authSchemes?: AuthScheme[];\n /**\n * Allows for connecting to HTTP endpoints instead of enforcing HTTPS.\n * CAUTION: Never use this option in production.\n */\n allowInsecureConnection?: boolean;\n}\n\n/**\n * Gets a pipeline policy that adds basic authentication to requests\n */\nexport function basicAuthenticationPolicy(\n options: BasicAuthenticationPolicyOptions,\n): PipelinePolicy {\n return {\n name: basicAuthenticationPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n // Ensure allowInsecureConnection is explicitly set when sending request to non-https URLs\n ensureSecureConnection(request, options);\n\n const scheme = (request.authSchemes ?? options.authSchemes)?.find(\n (x) => x.kind === \"http\" && x.scheme === \"basic\",\n );\n\n // Skip adding authentication header if no basic authentication scheme is found\n if (!scheme) {\n return next(request);\n }\n\n const { username, password } = options.credential;\n const headerValue = uint8ArrayToString(\n stringToUint8Array(`${username}:${password}`, \"utf-8\"),\n \"base64\",\n );\n request.headers.set(\"Authorization\", `Basic ${headerValue}`);\n return next(request);\n },\n };\n}\n"]}
1
+ {"version":3,"file":"basicAuthenticationPolicy.js","sourceRoot":"","sources":["../../../../src/policies/auth/basicAuthenticationPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,4BAA4B,CAAC;AAqB1E;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAyC;IAEzC,OAAO;QACL,IAAI,EAAE,6BAA6B;QACnC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,0FAA0F;YAC1F,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAEzC,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,CAC/D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,OAAO,CACjD,CAAC;YAEF,+EAA+E;YAC/E,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;YAED,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAClD,MAAM,WAAW,GAAG,kBAAkB,CACpC,kBAAkB,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,EAAE,OAAO,CAAC,EACtD,QAAQ,CACT,CAAC;YACF,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,SAAS,WAAW,EAAE,CAAC,CAAC;YAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { BasicCredential } from \"../../auth/credentials.js\";\nimport type { AuthScheme } from \"../../auth/schemes.js\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"../../interfaces.js\";\nimport type { PipelinePolicy } from \"../../pipeline.js\";\nimport { stringToUint8Array, uint8ArrayToString } from \"#platform/bytesEncoding\";\nimport { ensureSecureConnection } from \"./checkInsecureConnection.js\";\n\n/**\n * Name of the Basic Authentication Policy\n */\nexport const basicAuthenticationPolicyName = \"bearerAuthenticationPolicy\";\n\n/**\n * Options for configuring the basic authentication policy\n */\nexport interface BasicAuthenticationPolicyOptions {\n /**\n * The credential used to authenticate requests\n */\n credential: BasicCredential;\n /**\n * Optional authentication schemes to use. If not provided, schemes from the request will be used.\n */\n authSchemes?: AuthScheme[];\n /**\n * Allows for connecting to HTTP endpoints instead of enforcing HTTPS.\n * CAUTION: Never use this option in production.\n */\n allowInsecureConnection?: boolean;\n}\n\n/**\n * Gets a pipeline policy that adds basic authentication to requests\n */\nexport function basicAuthenticationPolicy(\n options: BasicAuthenticationPolicyOptions,\n): PipelinePolicy {\n return {\n name: basicAuthenticationPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n // Ensure allowInsecureConnection is explicitly set when sending request to non-https URLs\n ensureSecureConnection(request, options);\n\n const scheme = (request.authSchemes ?? options.authSchemes)?.find(\n (x) => x.kind === \"http\" && x.scheme === \"basic\",\n );\n\n // Skip adding authentication header if no basic authentication scheme is found\n if (!scheme) {\n return next(request);\n }\n\n const { username, password } = options.credential;\n const headerValue = uint8ArrayToString(\n stringToUint8Array(`${username}:${password}`, \"utf-8\"),\n \"base64\",\n );\n request.headers.set(\"Authorization\", `Basic ${headerValue}`);\n return next(request);\n },\n };\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { logger } from "../../log.js";
4
+ import { emitNodeWarning } from "../../env.js";
4
5
  // Ensure the warining is only emitted once
5
6
  let insecureConnectionWarningEmmitted = false;
6
7
  /**
@@ -28,9 +29,9 @@ function allowInsecureConnection(request, options) {
28
29
  function emitInsecureConnectionWarning() {
29
30
  const warning = "Sending token over insecure transport. Assume any token issued is compromised.";
30
31
  logger.warning(warning);
31
- if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) {
32
+ if (!insecureConnectionWarningEmmitted) {
32
33
  insecureConnectionWarningEmmitted = true;
33
- process.emitWarning(warning);
34
+ emitNodeWarning(warning);
34
35
  }
35
36
  }
36
37
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"checkInsecureConnection.js","sourceRoot":"","sources":["../../../../src/policies/auth/checkInsecureConnection.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,2CAA2C;AAC3C,IAAI,iCAAiC,GAAG,KAAK,CAAC;AAE9C;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAC9B,OAAwB,EACxB,OAA8C;IAE9C,IAAI,OAAO,CAAC,uBAAuB,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;QACvE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,GAAG,CAAC,QAAQ,KAAK,WAAW,IAAI,GAAG,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;YACjE,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,6BAA6B;IACpC,MAAM,OAAO,GAAG,gFAAgF,CAAC;IAEjG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAExB,IAAI,OAAO,OAAO,EAAE,WAAW,KAAK,UAAU,IAAI,CAAC,iCAAiC,EAAE,CAAC;QACrF,iCAAiC,GAAG,IAAI,CAAC;QACzC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAwB,EACxB,OAA8C;IAE9C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACtD,IAAI,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;YAC9C,6BAA6B,EAAE,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CACb,+GAA+G,CAChH,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelineRequest } from \"../../interfaces.js\";\nimport { logger } from \"../../log.js\";\n\n// Ensure the warining is only emitted once\nlet insecureConnectionWarningEmmitted = false;\n\n/**\n * Checks if the request is allowed to be sent over an insecure connection.\n *\n * A request is allowed to be sent over an insecure connection when:\n * - The `allowInsecureConnection` option is set to `true`.\n * - The request has the `allowInsecureConnection` property set to `true`.\n * - The request is being sent to `localhost` or `127.0.0.1`\n */\nfunction allowInsecureConnection(\n request: PipelineRequest,\n options: { allowInsecureConnection?: boolean },\n): boolean {\n if (options.allowInsecureConnection && request.allowInsecureConnection) {\n const url = new URL(request.url);\n if (url.hostname === \"localhost\" || url.hostname === \"127.0.0.1\") {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Logs a warning about sending a token over an insecure connection.\n *\n * This function will emit a node warning once, but log the warning every time.\n */\nfunction emitInsecureConnectionWarning(): void {\n const warning = \"Sending token over insecure transport. Assume any token issued is compromised.\";\n\n logger.warning(warning);\n\n if (typeof process?.emitWarning === \"function\" && !insecureConnectionWarningEmmitted) {\n insecureConnectionWarningEmmitted = true;\n process.emitWarning(warning);\n }\n}\n\n/**\n * Ensures that authentication is only allowed over HTTPS unless explicitly allowed.\n * Throws an error if the connection is not secure and not explicitly allowed.\n */\nexport function ensureSecureConnection(\n request: PipelineRequest,\n options: { allowInsecureConnection?: boolean },\n): void {\n if (!request.url.toLowerCase().startsWith(\"https://\")) {\n if (allowInsecureConnection(request, options)) {\n emitInsecureConnectionWarning();\n } else {\n throw new Error(\n \"Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false.\",\n );\n }\n }\n}\n"]}
1
+ {"version":3,"file":"checkInsecureConnection.js","sourceRoot":"","sources":["../../../../src/policies/auth/checkInsecureConnection.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,2CAA2C;AAC3C,IAAI,iCAAiC,GAAG,KAAK,CAAC;AAE9C;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAC9B,OAAwB,EACxB,OAA8C;IAE9C,IAAI,OAAO,CAAC,uBAAuB,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;QACvE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,GAAG,CAAC,QAAQ,KAAK,WAAW,IAAI,GAAG,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;YACjE,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,6BAA6B;IACpC,MAAM,OAAO,GAAG,gFAAgF,CAAC;IAEjG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAExB,IAAI,CAAC,iCAAiC,EAAE,CAAC;QACvC,iCAAiC,GAAG,IAAI,CAAC;QACzC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAwB,EACxB,OAA8C;IAE9C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACtD,IAAI,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;YAC9C,6BAA6B,EAAE,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CACb,+GAA+G,CAChH,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelineRequest } from \"../../interfaces.js\";\nimport { logger } from \"../../log.js\";\nimport { emitNodeWarning } from \"#platform/env\";\n\n// Ensure the warining is only emitted once\nlet insecureConnectionWarningEmmitted = false;\n\n/**\n * Checks if the request is allowed to be sent over an insecure connection.\n *\n * A request is allowed to be sent over an insecure connection when:\n * - The `allowInsecureConnection` option is set to `true`.\n * - The request has the `allowInsecureConnection` property set to `true`.\n * - The request is being sent to `localhost` or `127.0.0.1`\n */\nfunction allowInsecureConnection(\n request: PipelineRequest,\n options: { allowInsecureConnection?: boolean },\n): boolean {\n if (options.allowInsecureConnection && request.allowInsecureConnection) {\n const url = new URL(request.url);\n if (url.hostname === \"localhost\" || url.hostname === \"127.0.0.1\") {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Logs a warning about sending a token over an insecure connection.\n *\n * This function will emit a node warning once, but log the warning every time.\n */\nfunction emitInsecureConnectionWarning(): void {\n const warning = \"Sending token over insecure transport. Assume any token issued is compromised.\";\n\n logger.warning(warning);\n\n if (!insecureConnectionWarningEmmitted) {\n insecureConnectionWarningEmmitted = true;\n emitNodeWarning(warning);\n }\n}\n\n/**\n * Ensures that authentication is only allowed over HTTPS unless explicitly allowed.\n * Throws an error if the connection is not secure and not explicitly allowed.\n */\nexport function ensureSecureConnection(\n request: PipelineRequest,\n options: { allowInsecureConnection?: boolean },\n): void {\n if (!request.url.toLowerCase().startsWith(\"https://\")) {\n if (allowInsecureConnection(request, options)) {\n emitInsecureConnectionWarning();\n } else {\n throw new Error(\n \"Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false.\",\n );\n }\n }\n}\n"]}
@@ -1,20 +1,12 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { stringToUint8Array } from "../util/bytesEncoding.js";
4
- import { isNodeLike } from "../util/checkEnvironment.js";
4
+ import { convertBodyToFormDataMap } from "../formData.js";
5
5
  import { createHttpHeaders } from "../httpHeaders.js";
6
6
  /**
7
7
  * The programmatic identifier of the formDataPolicy.
8
8
  */
9
9
  export const formDataPolicyName = "formDataPolicy";
10
- function formDataToFormDataMap(formData) {
11
- const formDataMap = {};
12
- for (const [key, value] of formData.entries()) {
13
- formDataMap[key] ??= [];
14
- formDataMap[key].push(value);
15
- }
16
- return formDataMap;
17
- }
18
10
  /**
19
11
  * A policy that encodes FormData on the request into the body.
20
12
  */
@@ -22,8 +14,9 @@ export function formDataPolicy() {
22
14
  return {
23
15
  name: formDataPolicyName,
24
16
  async sendRequest(request, next) {
25
- if (isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) {
26
- request.formData = formDataToFormDataMap(request.body);
17
+ const converted = convertBodyToFormDataMap(request.body);
18
+ if (converted) {
19
+ request.formData = converted;
27
20
  request.body = undefined;
28
21
  }
29
22
  if (request.formData) {
@@ -1 +1 @@
1
- {"version":3,"file":"formDataPolicy.js","sourceRoot":"","sources":["../../../src/policies/formDataPolicy.ts"],"names":[],"mappings":"AAAA,uCAA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ringToUint8Array } from \"../util/bytesEncoding.js\";\nimport { isNodeLike } from \"../util/checkEnvironment.js\";\nimport { createHttpHeaders } from \"../httpHeaders.js\";\nimport type {\n BodyPart,\n FormDataMap,\n FormDataValue,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"../interfaces.js\";\nimport type { PipelinePolicy } from \"../pipeline.js\";\n\n/**\n * The programmatic identifier of the formDataPolicy.\n */\nexport const formDataPolicyName = \"formDataPolicy\";\n\nfunction formDataToFormDataMap(formData: FormData): FormDataMap {\n const formDataMap: FormDataMap = {};\n for (const [key, value] of formData.entries()) {\n formDataMap[key] ??= [];\n (formDataMap[key] as FormDataValue[]).push(value);\n }\n return formDataMap;\n}\n\n/**\n * A policy that encodes FormData on the request into the body.\n */\nexport function formDataPolicy(): PipelinePolicy {\n return {\n name: formDataPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (isNodeLike && typeof FormData !== \"undefined\" && request.body instanceof FormData) {\n request.formData = formDataToFormDataMap(request.body);\n request.body = undefined;\n }\n\n if (request.formData) {\n const contentType = request.headers.get(\"Content-Type\");\n if (contentType && contentType.indexOf(\"application/x-www-form-urlencoded\") !== -1) {\n request.body = wwwFormUrlEncode(request.formData);\n } else {\n await prepareFormData(request.formData, request);\n }\n\n request.formData = undefined;\n }\n return next(request);\n },\n };\n}\n\nfunction wwwFormUrlEncode(formData: FormDataMap): string {\n const urlSearchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(formData)) {\n if (Array.isArray(value)) {\n for (const subValue of value) {\n urlSearchParams.append(key, subValue.toString());\n }\n } else {\n urlSearchParams.append(key, value.toString());\n }\n }\n return urlSearchParams.toString();\n}\n\nasync function prepareFormData(formData: FormDataMap, request: PipelineRequest): Promise<void> {\n // validate content type (multipart/form-data)\n const contentType = request.headers.get(\"Content-Type\");\n if (contentType && !contentType.startsWith(\"multipart/form-data\")) {\n // content type is specified and is not multipart/form-data. Exit.\n return;\n }\n\n request.headers.set(\"Content-Type\", contentType ?? \"multipart/form-data\");\n\n // set body to MultipartRequestBody using content from FormDataMap\n const parts: BodyPart[] = [];\n\n for (const [fieldName, values] of Object.entries(formData)) {\n for (const value of Array.isArray(values) ? values : [values]) {\n if (typeof value === \"string\") {\n parts.push({\n headers: createHttpHeaders({\n \"Content-Disposition\": `form-data; name=\"${fieldName}\"`,\n }),\n body: stringToUint8Array(value, \"utf-8\"),\n });\n } else if (value === undefined || value === null || typeof value !== \"object\") {\n throw new Error(\n `Unexpected value for key ${fieldName}: ${value}. Value should be serialized to string first.`,\n );\n } else {\n // using || instead of ?? here since if value.name is empty we should create a file name\n const fileName = (value as File).name || \"blob\";\n const headers = createHttpHeaders();\n headers.set(\n \"Content-Disposition\",\n `form-data; name=\"${fieldName}\"; filename=\"${fileName}\"`,\n );\n\n // again, || is used since an empty value.type means the content type is unset\n headers.set(\"Content-Type\", value.type || \"application/octet-stream\");\n\n parts.push({\n headers,\n body: value,\n });\n }\n }\n }\n request.multipartBody = { parts };\n}\n"]}
1
+ {"version":3,"file":"formDataPolicy.js","sourceRoot":"","sources":["../../../src/policies/formDataPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAUtD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAEnD;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,IAAI,EAAE,kBAAkB;QACxB,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,MAAM,SAAS,GAAG,wBAAwB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACzD,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,CAAC,QAAQ,GAAG,S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QAAQ,GAAG,CACzD,CAAC;gBAEF,8EAA8E;gBAC9E,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,IAAI,IAAI,0BAA0B,CAAC,CAAC;gBAEtE,KAAK,CAAC,IAAI,CAAC;oBACT,OAAO;oBACP,IAAI,EAAE,KAAK;iBACZ,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,CAAC,aAAa,GAAG,EAAE,KAAK,EAAE,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { stringToUint8Array } from \"#platform/bytesEncoding\";\nimport { convertBodyToFormDataMap } from \"#platform/formData\";\nimport { createHttpHeaders } from \"../httpHeaders.js\";\nimport type {\n BodyPart,\n FormDataMap,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"../interfaces.js\";\nimport type { PipelinePolicy } from \"../pipeline.js\";\n\n/**\n * The programmatic identifier of the formDataPolicy.\n */\nexport const formDataPolicyName = \"formDataPolicy\";\n\n/**\n * A policy that encodes FormData on the request into the body.\n */\nexport function formDataPolicy(): PipelinePolicy {\n return {\n name: formDataPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const converted = convertBodyToFormDataMap(request.body);\n if (converted) {\n request.formData = converted;\n request.body = undefined;\n }\n\n if (request.formData) {\n const contentType = request.headers.get(\"Content-Type\");\n if (contentType && contentType.indexOf(\"application/x-www-form-urlencoded\") !== -1) {\n request.body = wwwFormUrlEncode(request.formData);\n } else {\n await prepareFormData(request.formData, request);\n }\n\n request.formData = undefined;\n }\n return next(request);\n },\n };\n}\n\nfunction wwwFormUrlEncode(formData: FormDataMap): string {\n const urlSearchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(formData)) {\n if (Array.isArray(value)) {\n for (const subValue of value) {\n urlSearchParams.append(key, subValue.toString());\n }\n } else {\n urlSearchParams.append(key, value.toString());\n }\n }\n return urlSearchParams.toString();\n}\n\nasync function prepareFormData(formData: FormDataMap, request: PipelineRequest): Promise<void> {\n // validate content type (multipart/form-data)\n const contentType = request.headers.get(\"Content-Type\");\n if (contentType && !contentType.startsWith(\"multipart/form-data\")) {\n // content type is specified and is not multipart/form-data. Exit.\n return;\n }\n\n request.headers.set(\"Content-Type\", contentType ?? \"multipart/form-data\");\n\n // set body to MultipartRequestBody using content from FormDataMap\n const parts: BodyPart[] = [];\n\n for (const [fieldName, values] of Object.entries(formData)) {\n for (const value of Array.isArray(values) ? values : [values]) {\n if (typeof value === \"string\") {\n parts.push({\n headers: createHttpHeaders({\n \"Content-Disposition\": `form-data; name=\"${fieldName}\"`,\n }),\n body: stringToUint8Array(value, \"utf-8\"),\n });\n } else if (value === undefined || value === null || typeof value !== \"object\") {\n throw new Error(\n `Unexpected value for key ${fieldName}: ${value}. Value should be serialized to string first.`,\n );\n } else {\n // using || instead of ?? here since if value.name is empty we should create a file name\n const fileName = (value as File).name || \"blob\";\n const headers = createHttpHeaders();\n headers.set(\n \"Content-Disposition\",\n `form-data; name=\"${fieldName}\"; filename=\"${fileName}\"`,\n );\n\n // again, || is used since an empty value.type means the content type is unset\n headers.set(\"Content-Type\", value.type || \"application/octet-stream\");\n\n parts.push({\n headers,\n body: value,\n });\n }\n }\n }\n request.multipartBody = { parts };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  export { agentPolicy, agentPolicyName } from "./agentPolicy.js";
2
- export { decompressResponsePolicy, decompressResponsePolicyName, } from "./decompressResponsePolicy.js";
2
+ export { decompressResponsePolicy, decompressResponsePolicyName } from "./decompressResponsePolicy.js";
3
3
  export { defaultRetryPolicy, defaultRetryPolicyName, type DefaultRetryPolicyOptions, } from "./defaultRetryPolicy.js";
4
4
  export { exponentialRetryPolicy, exponentialRetryPolicyName, type ExponentialRetryPolicyOptions, } from "./exponentialRetryPolicy.js";
5
5
  export { retryPolicy, type RetryPolicyOptions } from "./retryPolicy.js";
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  export { agentPolicy, agentPolicyName } from "./agentPolicy.js";
4
- export { decompressResponsePolicy, decompressResponsePolicyName, } from "./decompressResponsePolicy.js";
4
+ export { decompressResponsePolicy, decompressResponsePolicyName } from "./decompressResponsePolicy.js";
5
5
  export { defaultRetryPolicy, defaultRetryPolicyName, } from "./defaultRetryPolicy.js";
6
6
  export { exponentialRetryPolicy, exponentialRetryPolicyName, } from "./exponentialRetryPolicy.js";
7
7
  export { retryPolicy } from "./retryPolicy.js";
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/policies/internal.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAE3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AAMxE,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAyB,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EACL,cAAc,EACd,kBAAkB,GAEnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EACL,eAAe,EACf,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { agentPolicy, agentPolicyName } from \"./agentPolicy.js\";\nexport {\n decompressResponsePolicy,\n decompressResponsePolicyName,\n} from \"./decompressResponsePolicy.js\";\nexport {\n defaultRetryPolicy,\n defaultRetryPolicyName,\n type DefaultRetryPolicyOptions,\n} from \"./defaultRetryPolicy.js\";\nexport {\n exponentialRetryPolicy,\n exponentialRetryPolicyName,\n type ExponentialRetryPolicyOptions,\n} from \"./exponentialRetryPolicy.js\";\nexport { retryPolicy, type RetryPolicyOptions } from \"./retryPolicy.js\";\nexport type {\n RetryInformation,\n RetryModifiers,\n RetryStrategy,\n} from \"../retryStrategies/retryStrategy.js\";\nexport { systemErrorRetryPolicy, systemErrorRetryPolicyName } from \"./systemErrorRetryPolicy.js\";\nexport { throttlingRetryPolicy, throttlingRetryPolicyName } from \"./throttlingRetryPolicy.js\";\nexport { formDataPolicy, formDataPolicyName } from \"./formDataPolicy.js\";\nexport { logPolicy, logPolicyName, type LogPolicyOptions } from \"./logPolicy.js\";\nexport { multipartPolicy, multipartPolicyName } from \"./multipartPolicy.js\";\nexport { proxyPolicy, proxyPolicyName, getDefaultProxySettings } from \"./proxyPolicy.js\";\nexport {\n redirectPolicy,\n redirectPolicyName,\n type RedirectPolicyOptions,\n} from \"./redirectPolicy.js\";\nexport { tlsPolicy, tlsPolicyName } from \"./tlsPolicy.js\";\nexport {\n userAgentPolicy,\n userAgentPolicyName,\n type UserAgentPolicyOptions,\n} from \"./userAgentPolicy.js\";\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/policies/internal.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAE3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AAMxE,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAyB,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EACL,cAAc,EACd,kBAAkB,GAEnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EACL,eAAe,EACf,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { agentPolicy, agentPolicyName } from \"./agentPolicy.js\";\nexport { decompressResponsePolicy, decompressResponsePolicyName } from \"#platform/decompress\";\nexport {\n defaultRetryPolicy,\n defaultRetryPolicyName,\n type DefaultRetryPolicyOptions,\n} from \"./defaultRetryPolicy.js\";\nexport {\n exponentialRetryPolicy,\n exponentialRetryPolicyName,\n type ExponentialRetryPolicyOptions,\n} from \"./exponentialRetryPolicy.js\";\nexport { retryPolicy, type RetryPolicyOptions } from \"./retryPolicy.js\";\nexport type {\n RetryInformation,\n RetryModifiers,\n RetryStrategy,\n} from \"../retryStrategies/retryStrategy.js\";\nexport { systemErrorRetryPolicy, systemErrorRetryPolicyName } from \"./systemErrorRetryPolicy.js\";\nexport { throttlingRetryPolicy, throttlingRetryPolicyName } from \"./throttlingRetryPolicy.js\";\nexport { formDataPolicy, formDataPolicyName } from \"./formDataPolicy.js\";\nexport { logPolicy, logPolicyName, type LogPolicyOptions } from \"./logPolicy.js\";\nexport { multipartPolicy, multipartPolicyName } from \"./multipartPolicy.js\";\nexport { proxyPolicy, proxyPolicyName, getDefaultProxySettings } from \"#platform/proxy\";\nexport {\n redirectPolicy,\n redirectPolicyName,\n type RedirectPolicyOptions,\n} from \"./redirectPolicy.js\";\nexport { tlsPolicy, tlsPolicyName } from \"./tlsPolicy.js\";\nexport {\n userAgentPolicy,\n userAgentPolicyName,\n type UserAgentPolicyOptions,\n} from \"./userAgentPolicy.js\";\n"]}