@teammy/server 0.1.4 → 0.1.5

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 (444) hide show
  1. package/dist/main.js +682 -24
  2. package/dist/web/assets/Assistant-Dm_p8EZl.js +1 -0
  3. package/dist/web/assets/{Dashboard-dCu2Cdxd.js → Dashboard-fwW9NxcC.js} +1 -1
  4. package/dist/web/assets/{Files-cRhoWviM.js → Files-D-KCDWmO.js} +1 -1
  5. package/dist/web/assets/{Markdown-Bq8P_NBV.js → Markdown-oZagG-wy.js} +1 -1
  6. package/dist/web/assets/{Sessions-BxHsX1C5.js → Sessions-BQhGiLvz.js} +1 -1
  7. package/dist/web/assets/{WorkspaceTree-CD94JsaJ.js → WorkspaceTree-B9733pV3.js} +1 -1
  8. package/dist/web/assets/{file-links-CFCIacLV.js → file-links-CD346_jf.js} +1 -1
  9. package/dist/web/assets/{index-B-MqU_88.css → index-Be5hGscJ.css} +1 -1
  10. package/dist/web/assets/index-BiiPuwDi.js +66 -0
  11. package/dist/web/index.html +2 -2
  12. package/node_modules/@wecom/aibot-node-sdk/README.md +786 -0
  13. package/node_modules/@wecom/aibot-node-sdk/dist/api.d.ts +17 -0
  14. package/node_modules/@wecom/aibot-node-sdk/dist/client.d.ts +217 -0
  15. package/node_modules/@wecom/aibot-node-sdk/dist/crypto.d.ts +12 -0
  16. package/node_modules/@wecom/aibot-node-sdk/dist/index.cjs.js +1563 -0
  17. package/node_modules/@wecom/aibot-node-sdk/dist/index.cjs.js.map +1 -0
  18. package/node_modules/@wecom/aibot-node-sdk/dist/index.d.ts +1324 -0
  19. package/node_modules/@wecom/aibot-node-sdk/dist/index.esm.js +1544 -0
  20. package/node_modules/@wecom/aibot-node-sdk/dist/index.esm.js.map +1 -0
  21. package/node_modules/@wecom/aibot-node-sdk/dist/logger.d.ts +14 -0
  22. package/node_modules/@wecom/aibot-node-sdk/dist/message-handler.d.ts +29 -0
  23. package/node_modules/@wecom/aibot-node-sdk/dist/types/api.d.ts +466 -0
  24. package/node_modules/@wecom/aibot-node-sdk/dist/types/common.d.ts +30 -0
  25. package/node_modules/@wecom/aibot-node-sdk/dist/types/config.d.ts +34 -0
  26. package/node_modules/@wecom/aibot-node-sdk/dist/types/event.d.ts +109 -0
  27. package/node_modules/@wecom/aibot-node-sdk/dist/types/index.d.ts +10 -0
  28. package/node_modules/@wecom/aibot-node-sdk/dist/types/message.d.ts +158 -0
  29. package/node_modules/@wecom/aibot-node-sdk/dist/utils.d.ts +19 -0
  30. package/node_modules/@wecom/aibot-node-sdk/dist/wecom-crypto/index.d.ts +46 -0
  31. package/node_modules/@wecom/aibot-node-sdk/dist/ws.d.ts +161 -0
  32. package/node_modules/@wecom/aibot-node-sdk/package.json +43 -0
  33. package/node_modules/asynckit/LICENSE +21 -0
  34. package/node_modules/asynckit/README.md +233 -0
  35. package/node_modules/asynckit/bench.js +76 -0
  36. package/node_modules/asynckit/index.js +6 -0
  37. package/node_modules/asynckit/lib/abort.js +29 -0
  38. package/node_modules/asynckit/lib/async.js +34 -0
  39. package/node_modules/asynckit/lib/defer.js +26 -0
  40. package/node_modules/asynckit/lib/iterate.js +75 -0
  41. package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  42. package/node_modules/asynckit/lib/readable_parallel.js +25 -0
  43. package/node_modules/asynckit/lib/readable_serial.js +25 -0
  44. package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  45. package/node_modules/asynckit/lib/state.js +37 -0
  46. package/node_modules/asynckit/lib/streamify.js +141 -0
  47. package/node_modules/asynckit/lib/terminator.js +29 -0
  48. package/node_modules/asynckit/package.json +63 -0
  49. package/node_modules/asynckit/parallel.js +43 -0
  50. package/node_modules/asynckit/serial.js +17 -0
  51. package/node_modules/asynckit/serialOrdered.js +75 -0
  52. package/node_modules/asynckit/stream.js +21 -0
  53. package/node_modules/axios/CHANGELOG.md +1934 -0
  54. package/node_modules/axios/LICENSE +7 -0
  55. package/node_modules/axios/MIGRATION_GUIDE.md +877 -0
  56. package/node_modules/axios/README.md +2786 -0
  57. package/node_modules/axios/dist/axios.js +6460 -0
  58. package/node_modules/axios/dist/axios.min.js +5 -0
  59. package/node_modules/axios/dist/axios.min.js.map +1 -0
  60. package/node_modules/axios/dist/browser/axios.cjs +6509 -0
  61. package/node_modules/axios/dist/esm/axios.js +6530 -0
  62. package/node_modules/axios/dist/esm/axios.min.js +3 -0
  63. package/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  64. package/node_modules/axios/dist/node/axios.cjs +7491 -0
  65. package/node_modules/axios/index.d.cts +785 -0
  66. package/node_modules/axios/index.d.ts +804 -0
  67. package/node_modules/axios/index.js +45 -0
  68. package/node_modules/axios/lib/adapters/README.md +36 -0
  69. package/node_modules/axios/lib/adapters/adapters.js +132 -0
  70. package/node_modules/axios/lib/adapters/fetch.js +749 -0
  71. package/node_modules/axios/lib/adapters/http.js +1609 -0
  72. package/node_modules/axios/lib/adapters/xhr.js +384 -0
  73. package/node_modules/axios/lib/axios.js +89 -0
  74. package/node_modules/axios/lib/cancel/CancelToken.js +135 -0
  75. package/node_modules/axios/lib/cancel/CanceledError.js +22 -0
  76. package/node_modules/axios/lib/cancel/isCancel.js +5 -0
  77. package/node_modules/axios/lib/core/Axios.js +361 -0
  78. package/node_modules/axios/lib/core/AxiosError.js +278 -0
  79. package/node_modules/axios/lib/core/AxiosHeaders.js +487 -0
  80. package/node_modules/axios/lib/core/InterceptorManager.js +182 -0
  81. package/node_modules/axios/lib/core/README.md +8 -0
  82. package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
  83. package/node_modules/axios/lib/core/buildFullPath.js +76 -0
  84. package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
  85. package/node_modules/axios/lib/core/dispatchRequest.js +115 -0
  86. package/node_modules/axios/lib/core/mergeConfig.js +237 -0
  87. package/node_modules/axios/lib/core/methodList.js +17 -0
  88. package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
  89. package/node_modules/axios/lib/core/settle.js +27 -0
  90. package/node_modules/axios/lib/core/transformData.js +28 -0
  91. package/node_modules/axios/lib/defaults/index.js +178 -0
  92. package/node_modules/axios/lib/defaults/transitional.js +11 -0
  93. package/node_modules/axios/lib/env/README.md +3 -0
  94. package/node_modules/axios/lib/env/classes/FormData.js +2 -0
  95. package/node_modules/axios/lib/env/data.js +1 -0
  96. package/node_modules/axios/lib/helpers/AxiosTransformStream.js +165 -0
  97. package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
  98. package/node_modules/axios/lib/helpers/Http2Sessions.js +122 -0
  99. package/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
  100. package/node_modules/axios/lib/helpers/README.md +7 -0
  101. package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
  102. package/node_modules/axios/lib/helpers/bind.js +14 -0
  103. package/node_modules/axios/lib/helpers/buildURL.js +69 -0
  104. package/node_modules/axios/lib/helpers/callbackify.js +18 -0
  105. package/node_modules/axios/lib/helpers/combineURLs.js +23 -0
  106. package/node_modules/axios/lib/helpers/composeSignals.js +71 -0
  107. package/node_modules/axios/lib/helpers/cookies.js +88 -0
  108. package/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
  109. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +193 -0
  110. package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
  111. package/node_modules/axios/lib/helpers/formDataToJSON.js +149 -0
  112. package/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
  113. package/node_modules/axios/lib/helpers/fromDataURI.js +75 -0
  114. package/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
  115. package/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  116. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +11 -0
  117. package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
  118. package/node_modules/axios/lib/helpers/null.js +2 -0
  119. package/node_modules/axios/lib/helpers/parseHeaders.js +72 -0
  120. package/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  121. package/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
  122. package/node_modules/axios/lib/helpers/readBlob.js +15 -0
  123. package/node_modules/axios/lib/helpers/resolveConfig.js +120 -0
  124. package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
  125. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +520 -0
  126. package/node_modules/axios/lib/helpers/speedometer.js +55 -0
  127. package/node_modules/axios/lib/helpers/spread.js +28 -0
  128. package/node_modules/axios/lib/helpers/throttle.js +45 -0
  129. package/node_modules/axios/lib/helpers/toFormData.js +279 -0
  130. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
  131. package/node_modules/axios/lib/helpers/trackStream.js +89 -0
  132. package/node_modules/axios/lib/helpers/validator.js +112 -0
  133. package/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  134. package/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  135. package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  136. package/node_modules/axios/lib/platform/browser/index.js +13 -0
  137. package/node_modules/axios/lib/platform/common/utils.js +52 -0
  138. package/node_modules/axios/lib/platform/index.js +7 -0
  139. package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
  140. package/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  141. package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  142. package/node_modules/axios/lib/platform/node/index.js +37 -0
  143. package/node_modules/axios/lib/utils.js +1201 -0
  144. package/node_modules/axios/node_modules/agent-base/README.md +145 -0
  145. package/node_modules/axios/node_modules/agent-base/dist/src/index.d.ts +78 -0
  146. package/node_modules/axios/node_modules/agent-base/dist/src/index.js +203 -0
  147. package/node_modules/axios/node_modules/agent-base/dist/src/index.js.map +1 -0
  148. package/node_modules/axios/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
  149. package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js +18 -0
  150. package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js.map +1 -0
  151. package/node_modules/axios/node_modules/agent-base/package.json +64 -0
  152. package/node_modules/axios/node_modules/agent-base/src/index.ts +345 -0
  153. package/node_modules/axios/node_modules/agent-base/src/promisify.ts +33 -0
  154. package/node_modules/axios/node_modules/https-proxy-agent/README.md +137 -0
  155. package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
  156. package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js +177 -0
  157. package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
  158. package/node_modules/axios/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
  159. package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js +14 -0
  160. package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js.map +1 -0
  161. package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
  162. package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
  163. package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
  164. package/node_modules/axios/node_modules/https-proxy-agent/package.json +56 -0
  165. package/node_modules/axios/package.json +202 -0
  166. package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
  167. package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  168. package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
  169. package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  170. package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
  171. package/node_modules/call-bind-apply-helpers/README.md +62 -0
  172. package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  173. package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
  174. package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  175. package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
  176. package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  177. package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
  178. package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  179. package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
  180. package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
  181. package/node_modules/call-bind-apply-helpers/index.js +15 -0
  182. package/node_modules/call-bind-apply-helpers/package.json +85 -0
  183. package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  184. package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  185. package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
  186. package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  187. package/node_modules/combined-stream/License +19 -0
  188. package/node_modules/combined-stream/Readme.md +138 -0
  189. package/node_modules/combined-stream/lib/combined_stream.js +208 -0
  190. package/node_modules/combined-stream/package.json +25 -0
  191. package/node_modules/delayed-stream/.npmignore +1 -0
  192. package/node_modules/delayed-stream/License +19 -0
  193. package/node_modules/delayed-stream/Makefile +7 -0
  194. package/node_modules/delayed-stream/Readme.md +141 -0
  195. package/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  196. package/node_modules/delayed-stream/package.json +27 -0
  197. package/node_modules/dunder-proto/.eslintrc +5 -0
  198. package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
  199. package/node_modules/dunder-proto/.nycrc +13 -0
  200. package/node_modules/dunder-proto/CHANGELOG.md +24 -0
  201. package/node_modules/dunder-proto/LICENSE +21 -0
  202. package/node_modules/dunder-proto/README.md +54 -0
  203. package/node_modules/dunder-proto/get.d.ts +5 -0
  204. package/node_modules/dunder-proto/get.js +30 -0
  205. package/node_modules/dunder-proto/package.json +76 -0
  206. package/node_modules/dunder-proto/set.d.ts +5 -0
  207. package/node_modules/dunder-proto/set.js +35 -0
  208. package/node_modules/dunder-proto/test/get.js +34 -0
  209. package/node_modules/dunder-proto/test/index.js +4 -0
  210. package/node_modules/dunder-proto/test/set.js +50 -0
  211. package/node_modules/dunder-proto/tsconfig.json +9 -0
  212. package/node_modules/es-define-property/.eslintrc +13 -0
  213. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  214. package/node_modules/es-define-property/.nycrc +9 -0
  215. package/node_modules/es-define-property/CHANGELOG.md +29 -0
  216. package/node_modules/es-define-property/LICENSE +21 -0
  217. package/node_modules/es-define-property/README.md +49 -0
  218. package/node_modules/es-define-property/index.d.ts +3 -0
  219. package/node_modules/es-define-property/index.js +14 -0
  220. package/node_modules/es-define-property/package.json +81 -0
  221. package/node_modules/es-define-property/test/index.js +56 -0
  222. package/node_modules/es-define-property/tsconfig.json +10 -0
  223. package/node_modules/es-errors/.eslintrc +5 -0
  224. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  225. package/node_modules/es-errors/CHANGELOG.md +40 -0
  226. package/node_modules/es-errors/LICENSE +21 -0
  227. package/node_modules/es-errors/README.md +55 -0
  228. package/node_modules/es-errors/eval.d.ts +3 -0
  229. package/node_modules/es-errors/eval.js +4 -0
  230. package/node_modules/es-errors/index.d.ts +3 -0
  231. package/node_modules/es-errors/index.js +4 -0
  232. package/node_modules/es-errors/package.json +80 -0
  233. package/node_modules/es-errors/range.d.ts +3 -0
  234. package/node_modules/es-errors/range.js +4 -0
  235. package/node_modules/es-errors/ref.d.ts +3 -0
  236. package/node_modules/es-errors/ref.js +4 -0
  237. package/node_modules/es-errors/syntax.d.ts +3 -0
  238. package/node_modules/es-errors/syntax.js +4 -0
  239. package/node_modules/es-errors/test/index.js +19 -0
  240. package/node_modules/es-errors/tsconfig.json +49 -0
  241. package/node_modules/es-errors/type.d.ts +3 -0
  242. package/node_modules/es-errors/type.js +4 -0
  243. package/node_modules/es-errors/uri.d.ts +3 -0
  244. package/node_modules/es-errors/uri.js +4 -0
  245. package/node_modules/es-object-atoms/.eslintrc +16 -0
  246. package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  247. package/node_modules/es-object-atoms/CHANGELOG.md +44 -0
  248. package/node_modules/es-object-atoms/LICENSE +21 -0
  249. package/node_modules/es-object-atoms/README.md +63 -0
  250. package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  251. package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  252. package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
  253. package/node_modules/es-object-atoms/ToObject.js +10 -0
  254. package/node_modules/es-object-atoms/index.d.ts +3 -0
  255. package/node_modules/es-object-atoms/index.js +4 -0
  256. package/node_modules/es-object-atoms/isObject.d.ts +3 -0
  257. package/node_modules/es-object-atoms/isObject.js +6 -0
  258. package/node_modules/es-object-atoms/package.json +79 -0
  259. package/node_modules/es-object-atoms/test/index.js +38 -0
  260. package/node_modules/es-object-atoms/tsconfig.json +7 -0
  261. package/node_modules/es-set-tostringtag/.eslintrc +13 -0
  262. package/node_modules/es-set-tostringtag/.nycrc +9 -0
  263. package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
  264. package/node_modules/es-set-tostringtag/LICENSE +21 -0
  265. package/node_modules/es-set-tostringtag/README.md +53 -0
  266. package/node_modules/es-set-tostringtag/index.d.ts +10 -0
  267. package/node_modules/es-set-tostringtag/index.js +35 -0
  268. package/node_modules/es-set-tostringtag/package.json +78 -0
  269. package/node_modules/es-set-tostringtag/test/index.js +85 -0
  270. package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
  271. package/node_modules/eventemitter3/LICENSE +21 -0
  272. package/node_modules/eventemitter3/README.md +85 -0
  273. package/node_modules/eventemitter3/dist/eventemitter3.esm.js +355 -0
  274. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +1 -0
  275. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +1 -0
  276. package/node_modules/eventemitter3/dist/eventemitter3.umd.js +363 -0
  277. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +1 -0
  278. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +1 -0
  279. package/node_modules/eventemitter3/index.d.ts +135 -0
  280. package/node_modules/eventemitter3/index.js +336 -0
  281. package/node_modules/eventemitter3/index.mjs +4 -0
  282. package/node_modules/eventemitter3/package.json +62 -0
  283. package/node_modules/follow-redirects/LICENSE +18 -0
  284. package/node_modules/follow-redirects/README.md +183 -0
  285. package/node_modules/follow-redirects/debug.js +15 -0
  286. package/node_modules/follow-redirects/http.js +1 -0
  287. package/node_modules/follow-redirects/https.js +1 -0
  288. package/node_modules/follow-redirects/index.js +714 -0
  289. package/node_modules/follow-redirects/package.json +58 -0
  290. package/node_modules/form-data/CHANGELOG.md +686 -0
  291. package/node_modules/form-data/License +19 -0
  292. package/node_modules/form-data/README.md +355 -0
  293. package/node_modules/form-data/index.d.ts +62 -0
  294. package/node_modules/form-data/lib/browser.js +4 -0
  295. package/node_modules/form-data/lib/form_data.js +506 -0
  296. package/node_modules/form-data/lib/populate.js +10 -0
  297. package/node_modules/form-data/package.json +82 -0
  298. package/node_modules/function-bind/.eslintrc +21 -0
  299. package/node_modules/function-bind/.github/FUNDING.yml +12 -0
  300. package/node_modules/function-bind/.github/SECURITY.md +3 -0
  301. package/node_modules/function-bind/.nycrc +13 -0
  302. package/node_modules/function-bind/CHANGELOG.md +136 -0
  303. package/node_modules/function-bind/LICENSE +20 -0
  304. package/node_modules/function-bind/README.md +46 -0
  305. package/node_modules/function-bind/implementation.js +84 -0
  306. package/node_modules/function-bind/index.js +5 -0
  307. package/node_modules/function-bind/package.json +87 -0
  308. package/node_modules/function-bind/test/.eslintrc +9 -0
  309. package/node_modules/function-bind/test/index.js +252 -0
  310. package/node_modules/get-intrinsic/.eslintrc +42 -0
  311. package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  312. package/node_modules/get-intrinsic/.nycrc +9 -0
  313. package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
  314. package/node_modules/get-intrinsic/LICENSE +21 -0
  315. package/node_modules/get-intrinsic/README.md +71 -0
  316. package/node_modules/get-intrinsic/index.js +378 -0
  317. package/node_modules/get-intrinsic/package.json +97 -0
  318. package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  319. package/node_modules/get-proto/.eslintrc +10 -0
  320. package/node_modules/get-proto/.github/FUNDING.yml +12 -0
  321. package/node_modules/get-proto/.nycrc +9 -0
  322. package/node_modules/get-proto/CHANGELOG.md +21 -0
  323. package/node_modules/get-proto/LICENSE +21 -0
  324. package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  325. package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
  326. package/node_modules/get-proto/README.md +50 -0
  327. package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  328. package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  329. package/node_modules/get-proto/index.d.ts +5 -0
  330. package/node_modules/get-proto/index.js +27 -0
  331. package/node_modules/get-proto/package.json +81 -0
  332. package/node_modules/get-proto/test/index.js +68 -0
  333. package/node_modules/get-proto/tsconfig.json +9 -0
  334. package/node_modules/gopd/.eslintrc +16 -0
  335. package/node_modules/gopd/.github/FUNDING.yml +12 -0
  336. package/node_modules/gopd/CHANGELOG.md +45 -0
  337. package/node_modules/gopd/LICENSE +21 -0
  338. package/node_modules/gopd/README.md +40 -0
  339. package/node_modules/gopd/gOPD.d.ts +1 -0
  340. package/node_modules/gopd/gOPD.js +4 -0
  341. package/node_modules/gopd/index.d.ts +5 -0
  342. package/node_modules/gopd/index.js +15 -0
  343. package/node_modules/gopd/package.json +77 -0
  344. package/node_modules/gopd/test/index.js +36 -0
  345. package/node_modules/gopd/tsconfig.json +9 -0
  346. package/node_modules/has-symbols/.eslintrc +11 -0
  347. package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  348. package/node_modules/has-symbols/.nycrc +9 -0
  349. package/node_modules/has-symbols/CHANGELOG.md +91 -0
  350. package/node_modules/has-symbols/LICENSE +21 -0
  351. package/node_modules/has-symbols/README.md +46 -0
  352. package/node_modules/has-symbols/index.d.ts +3 -0
  353. package/node_modules/has-symbols/index.js +14 -0
  354. package/node_modules/has-symbols/package.json +111 -0
  355. package/node_modules/has-symbols/shams.d.ts +3 -0
  356. package/node_modules/has-symbols/shams.js +45 -0
  357. package/node_modules/has-symbols/test/index.js +22 -0
  358. package/node_modules/has-symbols/test/shams/core-js.js +29 -0
  359. package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  360. package/node_modules/has-symbols/test/tests.js +58 -0
  361. package/node_modules/has-symbols/tsconfig.json +10 -0
  362. package/node_modules/has-tostringtag/.eslintrc +5 -0
  363. package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
  364. package/node_modules/has-tostringtag/.nycrc +13 -0
  365. package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
  366. package/node_modules/has-tostringtag/LICENSE +21 -0
  367. package/node_modules/has-tostringtag/README.md +46 -0
  368. package/node_modules/has-tostringtag/index.d.ts +3 -0
  369. package/node_modules/has-tostringtag/index.js +8 -0
  370. package/node_modules/has-tostringtag/package.json +108 -0
  371. package/node_modules/has-tostringtag/shams.d.ts +3 -0
  372. package/node_modules/has-tostringtag/shams.js +8 -0
  373. package/node_modules/has-tostringtag/test/index.js +21 -0
  374. package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
  375. package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
  376. package/node_modules/has-tostringtag/test/tests.js +15 -0
  377. package/node_modules/has-tostringtag/tsconfig.json +49 -0
  378. package/node_modules/hasown/.github/FUNDING.yml +12 -0
  379. package/node_modules/hasown/.nycrc +13 -0
  380. package/node_modules/hasown/CHANGELOG.md +58 -0
  381. package/node_modules/hasown/LICENSE +21 -0
  382. package/node_modules/hasown/README.md +40 -0
  383. package/node_modules/hasown/eslint.config.mjs +6 -0
  384. package/node_modules/hasown/index.d.ts +3 -0
  385. package/node_modules/hasown/index.js +8 -0
  386. package/node_modules/hasown/package.json +91 -0
  387. package/node_modules/hasown/tsconfig.json +6 -0
  388. package/node_modules/math-intrinsics/.eslintrc +16 -0
  389. package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  390. package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
  391. package/node_modules/math-intrinsics/LICENSE +21 -0
  392. package/node_modules/math-intrinsics/README.md +50 -0
  393. package/node_modules/math-intrinsics/abs.d.ts +1 -0
  394. package/node_modules/math-intrinsics/abs.js +4 -0
  395. package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  396. package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  397. package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  398. package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  399. package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  400. package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
  401. package/node_modules/math-intrinsics/floor.d.ts +1 -0
  402. package/node_modules/math-intrinsics/floor.js +4 -0
  403. package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
  404. package/node_modules/math-intrinsics/isFinite.js +12 -0
  405. package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
  406. package/node_modules/math-intrinsics/isInteger.js +16 -0
  407. package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
  408. package/node_modules/math-intrinsics/isNaN.js +6 -0
  409. package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  410. package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
  411. package/node_modules/math-intrinsics/max.d.ts +1 -0
  412. package/node_modules/math-intrinsics/max.js +4 -0
  413. package/node_modules/math-intrinsics/min.d.ts +1 -0
  414. package/node_modules/math-intrinsics/min.js +4 -0
  415. package/node_modules/math-intrinsics/mod.d.ts +3 -0
  416. package/node_modules/math-intrinsics/mod.js +9 -0
  417. package/node_modules/math-intrinsics/package.json +86 -0
  418. package/node_modules/math-intrinsics/pow.d.ts +1 -0
  419. package/node_modules/math-intrinsics/pow.js +4 -0
  420. package/node_modules/math-intrinsics/round.d.ts +1 -0
  421. package/node_modules/math-intrinsics/round.js +4 -0
  422. package/node_modules/math-intrinsics/sign.d.ts +3 -0
  423. package/node_modules/math-intrinsics/sign.js +11 -0
  424. package/node_modules/math-intrinsics/test/index.js +192 -0
  425. package/node_modules/math-intrinsics/tsconfig.json +3 -0
  426. package/node_modules/mime-db/HISTORY.md +507 -0
  427. package/node_modules/mime-db/LICENSE +23 -0
  428. package/node_modules/mime-db/README.md +100 -0
  429. package/node_modules/mime-db/db.json +8519 -0
  430. package/node_modules/mime-db/index.js +12 -0
  431. package/node_modules/mime-db/package.json +60 -0
  432. package/node_modules/mime-types/HISTORY.md +397 -0
  433. package/node_modules/mime-types/LICENSE +23 -0
  434. package/node_modules/mime-types/README.md +113 -0
  435. package/node_modules/mime-types/index.js +188 -0
  436. package/node_modules/mime-types/package.json +44 -0
  437. package/node_modules/proxy-from-env/LICENSE +20 -0
  438. package/node_modules/proxy-from-env/README.md +163 -0
  439. package/node_modules/proxy-from-env/index.cjs +105 -0
  440. package/node_modules/proxy-from-env/index.js +103 -0
  441. package/node_modules/proxy-from-env/package.json +43 -0
  442. package/package.json +2 -1
  443. package/dist/web/assets/Assistant-DSQAdSiW.js +0 -1
  444. package/dist/web/assets/index-BXpTaAUz.js +0 -66
@@ -0,0 +1,714 @@
1
+ var url = require("url");
2
+ var URL = url.URL;
3
+ var http = require("http");
4
+ var https = require("https");
5
+ var Writable = require("stream").Writable;
6
+ var assert = require("assert");
7
+ var debug = require("./debug");
8
+
9
+ // Preventive platform detection
10
+ // istanbul ignore next
11
+ (function detectUnsupportedEnvironment() {
12
+ var looksLikeNode = typeof process !== "undefined";
13
+ var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
14
+ var looksLikeV8 = isFunction(Error.captureStackTrace);
15
+ if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
16
+ console.warn("The follow-redirects package should be excluded from browser builds.");
17
+ }
18
+ }());
19
+
20
+ // Whether to use the native URL object or the legacy url module
21
+ var useNativeURL = false;
22
+ try {
23
+ assert(new URL(""));
24
+ }
25
+ catch (error) {
26
+ useNativeURL = error.code === "ERR_INVALID_URL";
27
+ }
28
+
29
+ // HTTP headers to drop across HTTP/HTTPS and domain boundaries
30
+ var sensitiveHeaders = [
31
+ "Authorization",
32
+ "Proxy-Authorization",
33
+ "Cookie",
34
+ ];
35
+
36
+ // URL fields to preserve in copy operations
37
+ var preservedUrlFields = [
38
+ "auth",
39
+ "host",
40
+ "hostname",
41
+ "href",
42
+ "path",
43
+ "pathname",
44
+ "port",
45
+ "protocol",
46
+ "query",
47
+ "search",
48
+ "hash",
49
+ ];
50
+
51
+ // Create handlers that pass events from native requests
52
+ var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
53
+ var eventHandlers = Object.create(null);
54
+ events.forEach(function (event) {
55
+ eventHandlers[event] = function (arg1, arg2, arg3) {
56
+ this._redirectable.emit(event, arg1, arg2, arg3);
57
+ };
58
+ });
59
+
60
+ // Error types with codes
61
+ var InvalidUrlError = createErrorType(
62
+ "ERR_INVALID_URL",
63
+ "Invalid URL",
64
+ TypeError
65
+ );
66
+ var RedirectionError = createErrorType(
67
+ "ERR_FR_REDIRECTION_FAILURE",
68
+ "Redirected request failed"
69
+ );
70
+ var TooManyRedirectsError = createErrorType(
71
+ "ERR_FR_TOO_MANY_REDIRECTS",
72
+ "Maximum number of redirects exceeded",
73
+ RedirectionError
74
+ );
75
+ var MaxBodyLengthExceededError = createErrorType(
76
+ "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
77
+ "Request body larger than maxBodyLength limit"
78
+ );
79
+ var WriteAfterEndError = createErrorType(
80
+ "ERR_STREAM_WRITE_AFTER_END",
81
+ "write after end"
82
+ );
83
+
84
+ // istanbul ignore next
85
+ var destroy = Writable.prototype.destroy || noop;
86
+
87
+ // An HTTP(S) request that can be redirected
88
+ function RedirectableRequest(options, responseCallback) {
89
+ // Initialize the request
90
+ Writable.call(this);
91
+ this._sanitizeOptions(options);
92
+ this._options = options;
93
+ this._ended = false;
94
+ this._ending = false;
95
+ this._redirectCount = 0;
96
+ this._redirects = [];
97
+ this._requestBodyLength = 0;
98
+ this._requestBodyBuffers = [];
99
+
100
+ // Attach a callback if passed
101
+ if (responseCallback) {
102
+ this.on("response", responseCallback);
103
+ }
104
+
105
+ // React to responses of native requests
106
+ var self = this;
107
+ this._onNativeResponse = function (response) {
108
+ try {
109
+ self._processResponse(response);
110
+ }
111
+ catch (cause) {
112
+ self.emit("error", cause instanceof RedirectionError ?
113
+ cause : new RedirectionError({ cause: cause }));
114
+ }
115
+ };
116
+
117
+ // Create filter for sensitive HTTP headers
118
+ this._headerFilter = new RegExp("^(?:" +
119
+ sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") +
120
+ ")$", "i");
121
+
122
+ // Perform the first request
123
+ this._performRequest();
124
+ }
125
+ RedirectableRequest.prototype = Object.create(Writable.prototype);
126
+
127
+ RedirectableRequest.prototype.abort = function () {
128
+ destroyRequest(this._currentRequest);
129
+ this._currentRequest.abort();
130
+ this.emit("abort");
131
+ };
132
+
133
+ RedirectableRequest.prototype.destroy = function (error) {
134
+ destroyRequest(this._currentRequest, error);
135
+ destroy.call(this, error);
136
+ return this;
137
+ };
138
+
139
+ // Writes buffered data to the current native request
140
+ RedirectableRequest.prototype.write = function (data, encoding, callback) {
141
+ // Writing is not allowed if end has been called
142
+ if (this._ending) {
143
+ throw new WriteAfterEndError();
144
+ }
145
+
146
+ // Validate input and shift parameters if necessary
147
+ if (!isString(data) && !isBuffer(data)) {
148
+ throw new TypeError("data should be a string, Buffer or Uint8Array");
149
+ }
150
+ if (isFunction(encoding)) {
151
+ callback = encoding;
152
+ encoding = null;
153
+ }
154
+
155
+ // Ignore empty buffers, since writing them doesn't invoke the callback
156
+ // https://github.com/nodejs/node/issues/22066
157
+ if (data.length === 0) {
158
+ if (callback) {
159
+ callback();
160
+ }
161
+ return;
162
+ }
163
+ // Only write when we don't exceed the maximum body length
164
+ if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
165
+ this._requestBodyLength += data.length;
166
+ this._requestBodyBuffers.push({ data: data, encoding: encoding });
167
+ this._currentRequest.write(data, encoding, callback);
168
+ }
169
+ // Error when we exceed the maximum body length
170
+ else {
171
+ this.emit("error", new MaxBodyLengthExceededError());
172
+ this.abort();
173
+ }
174
+ };
175
+
176
+ // Ends the current native request
177
+ RedirectableRequest.prototype.end = function (data, encoding, callback) {
178
+ // Shift parameters if necessary
179
+ if (isFunction(data)) {
180
+ callback = data;
181
+ data = encoding = null;
182
+ }
183
+ else if (isFunction(encoding)) {
184
+ callback = encoding;
185
+ encoding = null;
186
+ }
187
+
188
+ // Write data if needed and end
189
+ if (!data) {
190
+ this._ended = this._ending = true;
191
+ this._currentRequest.end(null, null, callback);
192
+ }
193
+ else {
194
+ var self = this;
195
+ var currentRequest = this._currentRequest;
196
+ this.write(data, encoding, function () {
197
+ self._ended = true;
198
+ currentRequest.end(null, null, callback);
199
+ });
200
+ this._ending = true;
201
+ }
202
+ };
203
+
204
+ // Sets a header value on the current native request
205
+ RedirectableRequest.prototype.setHeader = function (name, value) {
206
+ this._options.headers[name] = value;
207
+ this._currentRequest.setHeader(name, value);
208
+ };
209
+
210
+ // Clears a header value on the current native request
211
+ RedirectableRequest.prototype.removeHeader = function (name) {
212
+ delete this._options.headers[name];
213
+ this._currentRequest.removeHeader(name);
214
+ };
215
+
216
+ // Global timeout for all underlying requests
217
+ RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
218
+ var self = this;
219
+
220
+ // Destroys the socket on timeout
221
+ function destroyOnTimeout(socket) {
222
+ socket.setTimeout(msecs);
223
+ socket.removeListener("timeout", socket.destroy);
224
+ socket.addListener("timeout", socket.destroy);
225
+ }
226
+
227
+ // Sets up a timer to trigger a timeout event
228
+ function startTimer(socket) {
229
+ if (self._timeout) {
230
+ clearTimeout(self._timeout);
231
+ }
232
+ self._timeout = setTimeout(function () {
233
+ self.emit("timeout");
234
+ clearTimer();
235
+ }, msecs);
236
+ destroyOnTimeout(socket);
237
+ }
238
+
239
+ // Stops a timeout from triggering
240
+ function clearTimer() {
241
+ // Clear the timeout
242
+ if (self._timeout) {
243
+ clearTimeout(self._timeout);
244
+ self._timeout = null;
245
+ }
246
+
247
+ // Clean up all attached listeners
248
+ self.removeListener("abort", clearTimer);
249
+ self.removeListener("error", clearTimer);
250
+ self.removeListener("response", clearTimer);
251
+ self.removeListener("close", clearTimer);
252
+ if (callback) {
253
+ self.removeListener("timeout", callback);
254
+ }
255
+ if (!self.socket) {
256
+ self._currentRequest.removeListener("socket", startTimer);
257
+ }
258
+ }
259
+
260
+ // Attach callback if passed
261
+ if (callback) {
262
+ this.on("timeout", callback);
263
+ }
264
+
265
+ // Start the timer if or when the socket is opened
266
+ if (this.socket) {
267
+ startTimer(this.socket);
268
+ }
269
+ else {
270
+ this._currentRequest.once("socket", startTimer);
271
+ }
272
+
273
+ // Clean up on events
274
+ this.on("socket", destroyOnTimeout);
275
+ this.on("abort", clearTimer);
276
+ this.on("error", clearTimer);
277
+ this.on("response", clearTimer);
278
+ this.on("close", clearTimer);
279
+
280
+ return this;
281
+ };
282
+
283
+ // Proxy all other public ClientRequest methods
284
+ [
285
+ "flushHeaders", "getHeader",
286
+ "setNoDelay", "setSocketKeepAlive",
287
+ ].forEach(function (method) {
288
+ RedirectableRequest.prototype[method] = function (a, b) {
289
+ return this._currentRequest[method](a, b);
290
+ };
291
+ });
292
+
293
+ // Proxy all public ClientRequest properties
294
+ ["aborted", "connection", "socket"].forEach(function (property) {
295
+ Object.defineProperty(RedirectableRequest.prototype, property, {
296
+ get: function () { return this._currentRequest[property]; },
297
+ });
298
+ });
299
+
300
+ RedirectableRequest.prototype._sanitizeOptions = function (options) {
301
+ // Ensure headers are always present
302
+ if (!options.headers) {
303
+ options.headers = {};
304
+ }
305
+ // Convert [header1, value1, header2, value2, …] to object
306
+ else if (Array.isArray(options.headers)) {
307
+ var headerList = options.headers;
308
+ options.headers = {};
309
+ for (var i = 0; i < headerList.length; i += 2) {
310
+ options.headers[headerList[i]] = headerList[i + 1];
311
+ }
312
+ }
313
+ // Ensure sensitive headers are always present
314
+ if (!Array.isArray(options.sensitiveHeaders)) {
315
+ options.sensitiveHeaders = [];
316
+ }
317
+
318
+ // Since http.request treats host as an alias of hostname,
319
+ // but the url module interprets host as hostname plus port,
320
+ // eliminate the host property to avoid confusion.
321
+ if (options.host) {
322
+ // Use hostname if set, because it has precedence
323
+ if (!options.hostname) {
324
+ options.hostname = options.host;
325
+ }
326
+ delete options.host;
327
+ }
328
+
329
+ // Complete the URL object when necessary
330
+ if (!options.pathname && options.path) {
331
+ var searchPos = options.path.indexOf("?");
332
+ if (searchPos < 0) {
333
+ options.pathname = options.path;
334
+ }
335
+ else {
336
+ options.pathname = options.path.substring(0, searchPos);
337
+ options.search = options.path.substring(searchPos);
338
+ }
339
+ }
340
+ };
341
+
342
+
343
+ // Executes the next native request (initial or redirect)
344
+ RedirectableRequest.prototype._performRequest = function () {
345
+ // Load the native protocol
346
+ var protocol = this._options.protocol;
347
+ var nativeProtocol = this._options.nativeProtocols[protocol];
348
+ if (!nativeProtocol) {
349
+ throw new TypeError("Unsupported protocol " + protocol);
350
+ }
351
+
352
+ // If specified, use the agent corresponding to the protocol
353
+ // (HTTP and HTTPS use different types of agents)
354
+ if (this._options.agents) {
355
+ var scheme = protocol.slice(0, -1);
356
+ this._options.agent = this._options.agents[scheme];
357
+ }
358
+
359
+ // Create the native request and set up its event handlers
360
+ var request = this._currentRequest =
361
+ nativeProtocol.request(this._options, this._onNativeResponse);
362
+ request._redirectable = this;
363
+ for (var event of events) {
364
+ request.on(event, eventHandlers[event]);
365
+ }
366
+
367
+ // RFC7230§5.3.1: When making a request directly to an origin server, […]
368
+ // a client MUST send only the absolute path […] as the request-target.
369
+ this._currentUrl = /^\//.test(this._options.path) ?
370
+ url.format(this._options) :
371
+ // When making a request to a proxy, […]
372
+ // a client MUST send the target URI in absolute-form […].
373
+ this._options.path;
374
+
375
+ // End a redirected request
376
+ // (The first request must be ended explicitly with RedirectableRequest#end)
377
+ if (this._isRedirect) {
378
+ // Write the request entity and end
379
+ var i = 0;
380
+ var self = this;
381
+ var buffers = this._requestBodyBuffers;
382
+ (function writeNext(error) {
383
+ // Only write if this request has not been redirected yet
384
+ // istanbul ignore else
385
+ if (request === self._currentRequest) {
386
+ // Report any write errors
387
+ // istanbul ignore if
388
+ if (error) {
389
+ self.emit("error", error);
390
+ }
391
+ // Write the next buffer if there are still left
392
+ else if (i < buffers.length) {
393
+ var buffer = buffers[i++];
394
+ // istanbul ignore else
395
+ if (!request.finished) {
396
+ request.write(buffer.data, buffer.encoding, writeNext);
397
+ }
398
+ }
399
+ // End the request if `end` has been called on us
400
+ else if (self._ended) {
401
+ request.end();
402
+ }
403
+ }
404
+ }());
405
+ }
406
+ };
407
+
408
+ // Processes a response from the current native request
409
+ RedirectableRequest.prototype._processResponse = function (response) {
410
+ // Store the redirected response
411
+ var statusCode = response.statusCode;
412
+ if (this._options.trackRedirects) {
413
+ this._redirects.push({
414
+ url: this._currentUrl,
415
+ headers: response.headers,
416
+ statusCode: statusCode,
417
+ });
418
+ }
419
+
420
+ // RFC7231§6.4: The 3xx (Redirection) class of status code indicates
421
+ // that further action needs to be taken by the user agent in order to
422
+ // fulfill the request. If a Location header field is provided,
423
+ // the user agent MAY automatically redirect its request to the URI
424
+ // referenced by the Location field value,
425
+ // even if the specific status code is not understood.
426
+
427
+ // If the response is not a redirect; return it as-is
428
+ var location = response.headers.location;
429
+ if (!location || this._options.followRedirects === false ||
430
+ statusCode < 300 || statusCode >= 400) {
431
+ response.responseUrl = this._currentUrl;
432
+ response.redirects = this._redirects;
433
+ this.emit("response", response);
434
+
435
+ // Clean up
436
+ this._requestBodyBuffers = [];
437
+ return;
438
+ }
439
+
440
+ // The response is a redirect, so abort the current request
441
+ destroyRequest(this._currentRequest);
442
+ // Discard the remainder of the response to avoid waiting for data
443
+ response.destroy();
444
+
445
+ // RFC7231§6.4: A client SHOULD detect and intervene
446
+ // in cyclical redirections (i.e., "infinite" redirection loops).
447
+ if (++this._redirectCount > this._options.maxRedirects) {
448
+ throw new TooManyRedirectsError();
449
+ }
450
+
451
+ // Store the request headers if applicable
452
+ var requestHeaders;
453
+ var beforeRedirect = this._options.beforeRedirect;
454
+ if (beforeRedirect) {
455
+ requestHeaders = Object.assign({
456
+ // The Host header was set by nativeProtocol.request
457
+ Host: response.req.getHeader("host"),
458
+ }, this._options.headers);
459
+ }
460
+
461
+ // RFC7231§6.4: Automatic redirection needs to done with
462
+ // care for methods not known to be safe, […]
463
+ // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
464
+ // the request method from POST to GET for the subsequent request.
465
+ var method = this._options.method;
466
+ if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
467
+ // RFC7231§6.4.4: The 303 (See Other) status code indicates that
468
+ // the server is redirecting the user agent to a different resource […]
469
+ // A user agent can perform a retrieval request targeting that URI
470
+ // (a GET or HEAD request if using HTTP) […]
471
+ (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
472
+ this._options.method = "GET";
473
+ // Drop a possible entity and headers related to it
474
+ this._requestBodyBuffers = [];
475
+ removeMatchingHeaders(/^content-/i, this._options.headers);
476
+ }
477
+
478
+ // Drop the Host header, as the redirect might lead to a different host
479
+ var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
480
+
481
+ // If the redirect is relative, carry over the host of the last request
482
+ var currentUrlParts = parseUrl(this._currentUrl);
483
+ var currentHost = currentHostHeader || currentUrlParts.host;
484
+ var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
485
+ url.format(Object.assign(currentUrlParts, { host: currentHost }));
486
+
487
+ // Create the redirected request
488
+ var redirectUrl = resolveUrl(location, currentUrl);
489
+ debug("redirecting to", redirectUrl.href);
490
+ this._isRedirect = true;
491
+ spreadUrlObject(redirectUrl, this._options);
492
+
493
+ // Drop confidential headers when redirecting to a less secure protocol
494
+ // or to a different domain that is not a superdomain
495
+ if (redirectUrl.protocol !== currentUrlParts.protocol &&
496
+ redirectUrl.protocol !== "https:" ||
497
+ redirectUrl.host !== currentHost &&
498
+ !isSubdomain(redirectUrl.host, currentHost)) {
499
+ removeMatchingHeaders(this._headerFilter, this._options.headers);
500
+ }
501
+
502
+ // Evaluate the beforeRedirect callback
503
+ if (isFunction(beforeRedirect)) {
504
+ var responseDetails = {
505
+ headers: response.headers,
506
+ statusCode: statusCode,
507
+ };
508
+ var requestDetails = {
509
+ url: currentUrl,
510
+ method: method,
511
+ headers: requestHeaders,
512
+ };
513
+ beforeRedirect(this._options, responseDetails, requestDetails);
514
+ this._sanitizeOptions(this._options);
515
+ }
516
+
517
+ // Perform the redirected request
518
+ this._performRequest();
519
+ };
520
+
521
+ // Wraps the key/value object of protocols with redirect functionality
522
+ function wrap(protocols) {
523
+ // Default settings
524
+ var exports = {
525
+ maxRedirects: 21,
526
+ maxBodyLength: 10 * 1024 * 1024,
527
+ };
528
+
529
+ // Wrap each protocol
530
+ var nativeProtocols = {};
531
+ Object.keys(protocols).forEach(function (scheme) {
532
+ var protocol = scheme + ":";
533
+ var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
534
+ var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
535
+
536
+ // Executes a request, following redirects
537
+ function request(input, options, callback) {
538
+ // Parse parameters, ensuring that input is an object
539
+ if (isURL(input)) {
540
+ input = spreadUrlObject(input);
541
+ }
542
+ else if (isString(input)) {
543
+ input = spreadUrlObject(parseUrl(input));
544
+ }
545
+ else {
546
+ callback = options;
547
+ options = validateUrl(input);
548
+ input = { protocol: protocol };
549
+ }
550
+ if (isFunction(options)) {
551
+ callback = options;
552
+ options = null;
553
+ }
554
+
555
+ // Set defaults
556
+ options = Object.assign({
557
+ maxRedirects: exports.maxRedirects,
558
+ maxBodyLength: exports.maxBodyLength,
559
+ }, input, options);
560
+ options.nativeProtocols = nativeProtocols;
561
+ if (!isString(options.host) && !isString(options.hostname)) {
562
+ options.hostname = "::1";
563
+ }
564
+
565
+ assert.equal(options.protocol, protocol, "protocol mismatch");
566
+ debug("options", options);
567
+ return new RedirectableRequest(options, callback);
568
+ }
569
+
570
+ // Executes a GET request, following redirects
571
+ function get(input, options, callback) {
572
+ var wrappedRequest = wrappedProtocol.request(input, options, callback);
573
+ wrappedRequest.end();
574
+ return wrappedRequest;
575
+ }
576
+
577
+ // Expose the properties on the wrapped protocol
578
+ Object.defineProperties(wrappedProtocol, {
579
+ request: { value: request, configurable: true, enumerable: true, writable: true },
580
+ get: { value: get, configurable: true, enumerable: true, writable: true },
581
+ });
582
+ });
583
+ return exports;
584
+ }
585
+
586
+ function noop() { /* empty */ }
587
+
588
+ function parseUrl(input) {
589
+ var parsed;
590
+ // istanbul ignore else
591
+ if (useNativeURL) {
592
+ parsed = new URL(input);
593
+ }
594
+ else {
595
+ // Ensure the URL is valid and absolute
596
+ parsed = validateUrl(url.parse(input));
597
+ if (!isString(parsed.protocol)) {
598
+ throw new InvalidUrlError({ input });
599
+ }
600
+ }
601
+ return parsed;
602
+ }
603
+
604
+ function resolveUrl(relative, base) {
605
+ // istanbul ignore next
606
+ return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
607
+ }
608
+
609
+ function validateUrl(input) {
610
+ if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
611
+ throw new InvalidUrlError({ input: input.href || input });
612
+ }
613
+ if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
614
+ throw new InvalidUrlError({ input: input.href || input });
615
+ }
616
+ return input;
617
+ }
618
+
619
+ function spreadUrlObject(urlObject, target) {
620
+ var spread = target || {};
621
+ for (var key of preservedUrlFields) {
622
+ spread[key] = urlObject[key];
623
+ }
624
+
625
+ // Fix IPv6 hostname
626
+ if (spread.hostname.startsWith("[")) {
627
+ spread.hostname = spread.hostname.slice(1, -1);
628
+ }
629
+ // Ensure port is a number
630
+ if (spread.port !== "") {
631
+ spread.port = Number(spread.port);
632
+ }
633
+ // Concatenate path
634
+ spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
635
+
636
+ return spread;
637
+ }
638
+
639
+ function removeMatchingHeaders(regex, headers) {
640
+ var lastValue;
641
+ for (var header in headers) {
642
+ if (regex.test(header)) {
643
+ lastValue = headers[header];
644
+ delete headers[header];
645
+ }
646
+ }
647
+ return (lastValue === null || typeof lastValue === "undefined") ?
648
+ undefined : String(lastValue).trim();
649
+ }
650
+
651
+ function createErrorType(code, message, baseClass) {
652
+ // Create constructor
653
+ function CustomError(properties) {
654
+ // istanbul ignore else
655
+ if (isFunction(Error.captureStackTrace)) {
656
+ Error.captureStackTrace(this, this.constructor);
657
+ }
658
+ Object.assign(this, properties || {});
659
+ this.code = code;
660
+ this.message = this.cause ? message + ": " + this.cause.message : message;
661
+ }
662
+
663
+ // Attach constructor and set default properties
664
+ CustomError.prototype = new (baseClass || Error)();
665
+ Object.defineProperties(CustomError.prototype, {
666
+ constructor: {
667
+ value: CustomError,
668
+ enumerable: false,
669
+ },
670
+ name: {
671
+ value: "Error [" + code + "]",
672
+ enumerable: false,
673
+ },
674
+ });
675
+ return CustomError;
676
+ }
677
+
678
+ function destroyRequest(request, error) {
679
+ for (var event of events) {
680
+ request.removeListener(event, eventHandlers[event]);
681
+ }
682
+ request.on("error", noop);
683
+ request.destroy(error);
684
+ }
685
+
686
+ function isSubdomain(subdomain, domain) {
687
+ assert(isString(subdomain) && isString(domain));
688
+ var dot = subdomain.length - domain.length - 1;
689
+ return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
690
+ }
691
+
692
+ function isString(value) {
693
+ return typeof value === "string" || value instanceof String;
694
+ }
695
+
696
+ function isFunction(value) {
697
+ return typeof value === "function";
698
+ }
699
+
700
+ function isBuffer(value) {
701
+ return typeof value === "object" && ("length" in value);
702
+ }
703
+
704
+ function isURL(value) {
705
+ return URL && value instanceof URL;
706
+ }
707
+
708
+ function escapeRegex(regex) {
709
+ return regex.replace(/[[\]\\/()*+?.^$|]/g, "\\$&");
710
+ }
711
+
712
+ // Exports
713
+ module.exports = wrap({ http: http, https: https });
714
+ module.exports.wrap = wrap;