@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.
- package/dist/main.js +682 -24
- package/dist/web/assets/Assistant-Dm_p8EZl.js +1 -0
- package/dist/web/assets/{Dashboard-dCu2Cdxd.js → Dashboard-fwW9NxcC.js} +1 -1
- package/dist/web/assets/{Files-cRhoWviM.js → Files-D-KCDWmO.js} +1 -1
- package/dist/web/assets/{Markdown-Bq8P_NBV.js → Markdown-oZagG-wy.js} +1 -1
- package/dist/web/assets/{Sessions-BxHsX1C5.js → Sessions-BQhGiLvz.js} +1 -1
- package/dist/web/assets/{WorkspaceTree-CD94JsaJ.js → WorkspaceTree-B9733pV3.js} +1 -1
- package/dist/web/assets/{file-links-CFCIacLV.js → file-links-CD346_jf.js} +1 -1
- package/dist/web/assets/{index-B-MqU_88.css → index-Be5hGscJ.css} +1 -1
- package/dist/web/assets/index-BiiPuwDi.js +66 -0
- package/dist/web/index.html +2 -2
- package/node_modules/@wecom/aibot-node-sdk/README.md +786 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/api.d.ts +17 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/client.d.ts +217 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/crypto.d.ts +12 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.cjs.js +1563 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.cjs.js.map +1 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.d.ts +1324 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.esm.js +1544 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.esm.js.map +1 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/logger.d.ts +14 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/message-handler.d.ts +29 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/api.d.ts +466 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/common.d.ts +30 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/config.d.ts +34 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/event.d.ts +109 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/index.d.ts +10 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/message.d.ts +158 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/utils.d.ts +19 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/wecom-crypto/index.d.ts +46 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/ws.d.ts +161 -0
- package/node_modules/@wecom/aibot-node-sdk/package.json +43 -0
- package/node_modules/asynckit/LICENSE +21 -0
- package/node_modules/asynckit/README.md +233 -0
- package/node_modules/asynckit/bench.js +76 -0
- package/node_modules/asynckit/index.js +6 -0
- package/node_modules/asynckit/lib/abort.js +29 -0
- package/node_modules/asynckit/lib/async.js +34 -0
- package/node_modules/asynckit/lib/defer.js +26 -0
- package/node_modules/asynckit/lib/iterate.js +75 -0
- package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/node_modules/asynckit/lib/state.js +37 -0
- package/node_modules/asynckit/lib/streamify.js +141 -0
- package/node_modules/asynckit/lib/terminator.js +29 -0
- package/node_modules/asynckit/package.json +63 -0
- package/node_modules/asynckit/parallel.js +43 -0
- package/node_modules/asynckit/serial.js +17 -0
- package/node_modules/asynckit/serialOrdered.js +75 -0
- package/node_modules/asynckit/stream.js +21 -0
- package/node_modules/axios/CHANGELOG.md +1934 -0
- package/node_modules/axios/LICENSE +7 -0
- package/node_modules/axios/MIGRATION_GUIDE.md +877 -0
- package/node_modules/axios/README.md +2786 -0
- package/node_modules/axios/dist/axios.js +6460 -0
- package/node_modules/axios/dist/axios.min.js +5 -0
- package/node_modules/axios/dist/axios.min.js.map +1 -0
- package/node_modules/axios/dist/browser/axios.cjs +6509 -0
- package/node_modules/axios/dist/esm/axios.js +6530 -0
- package/node_modules/axios/dist/esm/axios.min.js +3 -0
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -0
- package/node_modules/axios/dist/node/axios.cjs +7491 -0
- package/node_modules/axios/index.d.cts +785 -0
- package/node_modules/axios/index.d.ts +804 -0
- package/node_modules/axios/index.js +45 -0
- package/node_modules/axios/lib/adapters/README.md +36 -0
- package/node_modules/axios/lib/adapters/adapters.js +132 -0
- package/node_modules/axios/lib/adapters/fetch.js +749 -0
- package/node_modules/axios/lib/adapters/http.js +1609 -0
- package/node_modules/axios/lib/adapters/xhr.js +384 -0
- package/node_modules/axios/lib/axios.js +89 -0
- package/node_modules/axios/lib/cancel/CancelToken.js +135 -0
- package/node_modules/axios/lib/cancel/CanceledError.js +22 -0
- package/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/node_modules/axios/lib/core/Axios.js +361 -0
- package/node_modules/axios/lib/core/AxiosError.js +278 -0
- package/node_modules/axios/lib/core/AxiosHeaders.js +487 -0
- package/node_modules/axios/lib/core/InterceptorManager.js +182 -0
- package/node_modules/axios/lib/core/README.md +8 -0
- package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
- package/node_modules/axios/lib/core/buildFullPath.js +76 -0
- package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +115 -0
- package/node_modules/axios/lib/core/mergeConfig.js +237 -0
- package/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
- package/node_modules/axios/lib/core/settle.js +27 -0
- package/node_modules/axios/lib/core/transformData.js +28 -0
- package/node_modules/axios/lib/defaults/index.js +178 -0
- package/node_modules/axios/lib/defaults/transitional.js +11 -0
- package/node_modules/axios/lib/env/README.md +3 -0
- package/node_modules/axios/lib/env/classes/FormData.js +2 -0
- package/node_modules/axios/lib/env/data.js +1 -0
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +165 -0
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
- package/node_modules/axios/lib/helpers/Http2Sessions.js +122 -0
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
- package/node_modules/axios/lib/helpers/README.md +7 -0
- package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
- package/node_modules/axios/lib/helpers/bind.js +14 -0
- package/node_modules/axios/lib/helpers/buildURL.js +69 -0
- package/node_modules/axios/lib/helpers/callbackify.js +18 -0
- package/node_modules/axios/lib/helpers/combineURLs.js +23 -0
- package/node_modules/axios/lib/helpers/composeSignals.js +71 -0
- package/node_modules/axios/lib/helpers/cookies.js +88 -0
- package/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +193 -0
- package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
- package/node_modules/axios/lib/helpers/formDataToJSON.js +149 -0
- package/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
- package/node_modules/axios/lib/helpers/fromDataURI.js +75 -0
- package/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
- package/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +11 -0
- package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/axios/lib/helpers/null.js +2 -0
- package/node_modules/axios/lib/helpers/parseHeaders.js +72 -0
- package/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
- package/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
- package/node_modules/axios/lib/helpers/readBlob.js +15 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +120 -0
- package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +520 -0
- package/node_modules/axios/lib/helpers/speedometer.js +55 -0
- package/node_modules/axios/lib/helpers/spread.js +28 -0
- package/node_modules/axios/lib/helpers/throttle.js +45 -0
- package/node_modules/axios/lib/helpers/toFormData.js +279 -0
- package/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
- package/node_modules/axios/lib/helpers/trackStream.js +89 -0
- package/node_modules/axios/lib/helpers/validator.js +112 -0
- package/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/browser/index.js +13 -0
- package/node_modules/axios/lib/platform/common/utils.js +52 -0
- package/node_modules/axios/lib/platform/index.js +7 -0
- package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
- package/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/node/index.js +37 -0
- package/node_modules/axios/lib/utils.js +1201 -0
- package/node_modules/axios/node_modules/agent-base/README.md +145 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.d.ts +78 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.js +203 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.js.map +1 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js +18 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js.map +1 -0
- package/node_modules/axios/node_modules/agent-base/package.json +64 -0
- package/node_modules/axios/node_modules/agent-base/src/index.ts +345 -0
- package/node_modules/axios/node_modules/agent-base/src/promisify.ts +33 -0
- package/node_modules/axios/node_modules/https-proxy-agent/README.md +137 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js +177 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js +14 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/package.json +56 -0
- package/node_modules/axios/package.json +202 -0
- package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/node_modules/combined-stream/License +19 -0
- package/node_modules/combined-stream/Readme.md +138 -0
- package/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/node_modules/combined-stream/package.json +25 -0
- package/node_modules/delayed-stream/.npmignore +1 -0
- package/node_modules/delayed-stream/License +19 -0
- package/node_modules/delayed-stream/Makefile +7 -0
- package/node_modules/delayed-stream/Readme.md +141 -0
- package/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/node_modules/delayed-stream/package.json +27 -0
- package/node_modules/dunder-proto/.eslintrc +5 -0
- package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/node_modules/dunder-proto/.nycrc +13 -0
- package/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/node_modules/dunder-proto/LICENSE +21 -0
- package/node_modules/dunder-proto/README.md +54 -0
- package/node_modules/dunder-proto/get.d.ts +5 -0
- package/node_modules/dunder-proto/get.js +30 -0
- package/node_modules/dunder-proto/package.json +76 -0
- package/node_modules/dunder-proto/set.d.ts +5 -0
- package/node_modules/dunder-proto/set.js +35 -0
- package/node_modules/dunder-proto/test/get.js +34 -0
- package/node_modules/dunder-proto/test/index.js +4 -0
- package/node_modules/dunder-proto/test/set.js +50 -0
- package/node_modules/dunder-proto/tsconfig.json +9 -0
- package/node_modules/es-define-property/.eslintrc +13 -0
- package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/node_modules/es-define-property/.nycrc +9 -0
- package/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/node_modules/es-define-property/LICENSE +21 -0
- package/node_modules/es-define-property/README.md +49 -0
- package/node_modules/es-define-property/index.d.ts +3 -0
- package/node_modules/es-define-property/index.js +14 -0
- package/node_modules/es-define-property/package.json +81 -0
- package/node_modules/es-define-property/test/index.js +56 -0
- package/node_modules/es-define-property/tsconfig.json +10 -0
- package/node_modules/es-errors/.eslintrc +5 -0
- package/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/node_modules/es-errors/CHANGELOG.md +40 -0
- package/node_modules/es-errors/LICENSE +21 -0
- package/node_modules/es-errors/README.md +55 -0
- package/node_modules/es-errors/eval.d.ts +3 -0
- package/node_modules/es-errors/eval.js +4 -0
- package/node_modules/es-errors/index.d.ts +3 -0
- package/node_modules/es-errors/index.js +4 -0
- package/node_modules/es-errors/package.json +80 -0
- package/node_modules/es-errors/range.d.ts +3 -0
- package/node_modules/es-errors/range.js +4 -0
- package/node_modules/es-errors/ref.d.ts +3 -0
- package/node_modules/es-errors/ref.js +4 -0
- package/node_modules/es-errors/syntax.d.ts +3 -0
- package/node_modules/es-errors/syntax.js +4 -0
- package/node_modules/es-errors/test/index.js +19 -0
- package/node_modules/es-errors/tsconfig.json +49 -0
- package/node_modules/es-errors/type.d.ts +3 -0
- package/node_modules/es-errors/type.js +4 -0
- package/node_modules/es-errors/uri.d.ts +3 -0
- package/node_modules/es-errors/uri.js +4 -0
- package/node_modules/es-object-atoms/.eslintrc +16 -0
- package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/node_modules/es-object-atoms/CHANGELOG.md +44 -0
- package/node_modules/es-object-atoms/LICENSE +21 -0
- package/node_modules/es-object-atoms/README.md +63 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/node_modules/es-object-atoms/ToObject.js +10 -0
- package/node_modules/es-object-atoms/index.d.ts +3 -0
- package/node_modules/es-object-atoms/index.js +4 -0
- package/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/node_modules/es-object-atoms/isObject.js +6 -0
- package/node_modules/es-object-atoms/package.json +79 -0
- package/node_modules/es-object-atoms/test/index.js +38 -0
- package/node_modules/es-object-atoms/tsconfig.json +7 -0
- package/node_modules/es-set-tostringtag/.eslintrc +13 -0
- package/node_modules/es-set-tostringtag/.nycrc +9 -0
- package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
- package/node_modules/es-set-tostringtag/LICENSE +21 -0
- package/node_modules/es-set-tostringtag/README.md +53 -0
- package/node_modules/es-set-tostringtag/index.d.ts +10 -0
- package/node_modules/es-set-tostringtag/index.js +35 -0
- package/node_modules/es-set-tostringtag/package.json +78 -0
- package/node_modules/es-set-tostringtag/test/index.js +85 -0
- package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
- package/node_modules/eventemitter3/LICENSE +21 -0
- package/node_modules/eventemitter3/README.md +85 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.js +355 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.js +363 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +1 -0
- package/node_modules/eventemitter3/index.d.ts +135 -0
- package/node_modules/eventemitter3/index.js +336 -0
- package/node_modules/eventemitter3/index.mjs +4 -0
- package/node_modules/eventemitter3/package.json +62 -0
- package/node_modules/follow-redirects/LICENSE +18 -0
- package/node_modules/follow-redirects/README.md +183 -0
- package/node_modules/follow-redirects/debug.js +15 -0
- package/node_modules/follow-redirects/http.js +1 -0
- package/node_modules/follow-redirects/https.js +1 -0
- package/node_modules/follow-redirects/index.js +714 -0
- package/node_modules/follow-redirects/package.json +58 -0
- package/node_modules/form-data/CHANGELOG.md +686 -0
- package/node_modules/form-data/License +19 -0
- package/node_modules/form-data/README.md +355 -0
- package/node_modules/form-data/index.d.ts +62 -0
- package/node_modules/form-data/lib/browser.js +4 -0
- package/node_modules/form-data/lib/form_data.js +506 -0
- package/node_modules/form-data/lib/populate.js +10 -0
- package/node_modules/form-data/package.json +82 -0
- package/node_modules/function-bind/.eslintrc +21 -0
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/CHANGELOG.md +136 -0
- package/node_modules/function-bind/LICENSE +20 -0
- package/node_modules/function-bind/README.md +46 -0
- package/node_modules/function-bind/implementation.js +84 -0
- package/node_modules/function-bind/index.js +5 -0
- package/node_modules/function-bind/package.json +87 -0
- package/node_modules/function-bind/test/.eslintrc +9 -0
- package/node_modules/function-bind/test/index.js +252 -0
- package/node_modules/get-intrinsic/.eslintrc +42 -0
- package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/node_modules/get-intrinsic/.nycrc +9 -0
- package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/node_modules/get-intrinsic/LICENSE +21 -0
- package/node_modules/get-intrinsic/README.md +71 -0
- package/node_modules/get-intrinsic/index.js +378 -0
- package/node_modules/get-intrinsic/package.json +97 -0
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/node_modules/get-proto/.eslintrc +10 -0
- package/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/node_modules/get-proto/.nycrc +9 -0
- package/node_modules/get-proto/CHANGELOG.md +21 -0
- package/node_modules/get-proto/LICENSE +21 -0
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/node_modules/get-proto/README.md +50 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/node_modules/get-proto/index.d.ts +5 -0
- package/node_modules/get-proto/index.js +27 -0
- package/node_modules/get-proto/package.json +81 -0
- package/node_modules/get-proto/test/index.js +68 -0
- package/node_modules/get-proto/tsconfig.json +9 -0
- package/node_modules/gopd/.eslintrc +16 -0
- package/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/node_modules/gopd/CHANGELOG.md +45 -0
- package/node_modules/gopd/LICENSE +21 -0
- package/node_modules/gopd/README.md +40 -0
- package/node_modules/gopd/gOPD.d.ts +1 -0
- package/node_modules/gopd/gOPD.js +4 -0
- package/node_modules/gopd/index.d.ts +5 -0
- package/node_modules/gopd/index.js +15 -0
- package/node_modules/gopd/package.json +77 -0
- package/node_modules/gopd/test/index.js +36 -0
- package/node_modules/gopd/tsconfig.json +9 -0
- package/node_modules/has-symbols/.eslintrc +11 -0
- package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/node_modules/has-symbols/.nycrc +9 -0
- package/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/node_modules/has-symbols/LICENSE +21 -0
- package/node_modules/has-symbols/README.md +46 -0
- package/node_modules/has-symbols/index.d.ts +3 -0
- package/node_modules/has-symbols/index.js +14 -0
- package/node_modules/has-symbols/package.json +111 -0
- package/node_modules/has-symbols/shams.d.ts +3 -0
- package/node_modules/has-symbols/shams.js +45 -0
- package/node_modules/has-symbols/test/index.js +22 -0
- package/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/node_modules/has-symbols/test/tests.js +58 -0
- package/node_modules/has-symbols/tsconfig.json +10 -0
- package/node_modules/has-tostringtag/.eslintrc +5 -0
- package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
- package/node_modules/has-tostringtag/.nycrc +13 -0
- package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
- package/node_modules/has-tostringtag/LICENSE +21 -0
- package/node_modules/has-tostringtag/README.md +46 -0
- package/node_modules/has-tostringtag/index.d.ts +3 -0
- package/node_modules/has-tostringtag/index.js +8 -0
- package/node_modules/has-tostringtag/package.json +108 -0
- package/node_modules/has-tostringtag/shams.d.ts +3 -0
- package/node_modules/has-tostringtag/shams.js +8 -0
- package/node_modules/has-tostringtag/test/index.js +21 -0
- package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
- package/node_modules/has-tostringtag/test/tests.js +15 -0
- package/node_modules/has-tostringtag/tsconfig.json +49 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/CHANGELOG.md +58 -0
- package/node_modules/hasown/LICENSE +21 -0
- package/node_modules/hasown/README.md +40 -0
- package/node_modules/hasown/eslint.config.mjs +6 -0
- package/node_modules/hasown/index.d.ts +3 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +91 -0
- package/node_modules/hasown/tsconfig.json +6 -0
- package/node_modules/math-intrinsics/.eslintrc +16 -0
- package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/node_modules/math-intrinsics/LICENSE +21 -0
- package/node_modules/math-intrinsics/README.md +50 -0
- package/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/node_modules/math-intrinsics/abs.js +4 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/node_modules/math-intrinsics/floor.js +4 -0
- package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/node_modules/math-intrinsics/isFinite.js +12 -0
- package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/isInteger.js +16 -0
- package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/node_modules/math-intrinsics/isNaN.js +6 -0
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/node_modules/math-intrinsics/max.d.ts +1 -0
- package/node_modules/math-intrinsics/max.js +4 -0
- package/node_modules/math-intrinsics/min.d.ts +1 -0
- package/node_modules/math-intrinsics/min.js +4 -0
- package/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/node_modules/math-intrinsics/mod.js +9 -0
- package/node_modules/math-intrinsics/package.json +86 -0
- package/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/node_modules/math-intrinsics/pow.js +4 -0
- package/node_modules/math-intrinsics/round.d.ts +1 -0
- package/node_modules/math-intrinsics/round.js +4 -0
- package/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/node_modules/math-intrinsics/sign.js +11 -0
- package/node_modules/math-intrinsics/test/index.js +192 -0
- package/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/node_modules/mime-db/HISTORY.md +507 -0
- package/node_modules/mime-db/LICENSE +23 -0
- package/node_modules/mime-db/README.md +100 -0
- package/node_modules/mime-db/db.json +8519 -0
- package/node_modules/mime-db/index.js +12 -0
- package/node_modules/mime-db/package.json +60 -0
- package/node_modules/mime-types/HISTORY.md +397 -0
- package/node_modules/mime-types/LICENSE +23 -0
- package/node_modules/mime-types/README.md +113 -0
- package/node_modules/mime-types/index.js +188 -0
- package/node_modules/mime-types/package.json +44 -0
- package/node_modules/proxy-from-env/LICENSE +20 -0
- package/node_modules/proxy-from-env/README.md +163 -0
- package/node_modules/proxy-from-env/index.cjs +105 -0
- package/node_modules/proxy-from-env/index.js +103 -0
- package/node_modules/proxy-from-env/package.json +43 -0
- package/package.json +2 -1
- package/dist/web/assets/Assistant-DSQAdSiW.js +0 -1
- package/dist/web/assets/index-BXpTaAUz.js +0 -66
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import net from 'net';
|
|
2
|
+
import http from 'http';
|
|
3
|
+
import https from 'https';
|
|
4
|
+
import { Duplex } from 'stream';
|
|
5
|
+
import { EventEmitter } from 'events';
|
|
6
|
+
import createDebug from 'debug';
|
|
7
|
+
import promisify from './promisify';
|
|
8
|
+
|
|
9
|
+
const debug = createDebug('agent-base');
|
|
10
|
+
|
|
11
|
+
function isAgent(v: any): v is createAgent.AgentLike {
|
|
12
|
+
return Boolean(v) && typeof v.addRequest === 'function';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function isSecureEndpoint(): boolean {
|
|
16
|
+
const { stack } = new Error();
|
|
17
|
+
if (typeof stack !== 'string') return false;
|
|
18
|
+
return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent;
|
|
22
|
+
function createAgent(
|
|
23
|
+
callback: createAgent.AgentCallback,
|
|
24
|
+
opts?: createAgent.AgentOptions
|
|
25
|
+
): createAgent.Agent;
|
|
26
|
+
function createAgent(
|
|
27
|
+
callback?: createAgent.AgentCallback | createAgent.AgentOptions,
|
|
28
|
+
opts?: createAgent.AgentOptions
|
|
29
|
+
) {
|
|
30
|
+
return new createAgent.Agent(callback, opts);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
namespace createAgent {
|
|
34
|
+
export interface ClientRequest extends http.ClientRequest {
|
|
35
|
+
_last?: boolean;
|
|
36
|
+
_hadError?: boolean;
|
|
37
|
+
method: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface AgentRequestOptions {
|
|
41
|
+
host?: string;
|
|
42
|
+
path?: string;
|
|
43
|
+
// `port` on `http.RequestOptions` can be a string or undefined,
|
|
44
|
+
// but `net.TcpNetConnectOpts` expects only a number
|
|
45
|
+
port: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface HttpRequestOptions
|
|
49
|
+
extends AgentRequestOptions,
|
|
50
|
+
Omit<http.RequestOptions, keyof AgentRequestOptions> {
|
|
51
|
+
secureEndpoint: false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface HttpsRequestOptions
|
|
55
|
+
extends AgentRequestOptions,
|
|
56
|
+
Omit<https.RequestOptions, keyof AgentRequestOptions> {
|
|
57
|
+
secureEndpoint: true;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type RequestOptions = HttpRequestOptions | HttpsRequestOptions;
|
|
61
|
+
|
|
62
|
+
export type AgentLike = Pick<createAgent.Agent, 'addRequest'> | http.Agent;
|
|
63
|
+
|
|
64
|
+
export type AgentCallbackReturn = Duplex | AgentLike;
|
|
65
|
+
|
|
66
|
+
export type AgentCallbackCallback = (
|
|
67
|
+
err?: Error | null,
|
|
68
|
+
socket?: createAgent.AgentCallbackReturn
|
|
69
|
+
) => void;
|
|
70
|
+
|
|
71
|
+
export type AgentCallbackPromise = (
|
|
72
|
+
req: createAgent.ClientRequest,
|
|
73
|
+
opts: createAgent.RequestOptions
|
|
74
|
+
) =>
|
|
75
|
+
| createAgent.AgentCallbackReturn
|
|
76
|
+
| Promise<createAgent.AgentCallbackReturn>;
|
|
77
|
+
|
|
78
|
+
export type AgentCallback = typeof Agent.prototype.callback;
|
|
79
|
+
|
|
80
|
+
export type AgentOptions = {
|
|
81
|
+
timeout?: number;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Base `http.Agent` implementation.
|
|
86
|
+
* No pooling/keep-alive is implemented by default.
|
|
87
|
+
*
|
|
88
|
+
* @param {Function} callback
|
|
89
|
+
* @api public
|
|
90
|
+
*/
|
|
91
|
+
export class Agent extends EventEmitter {
|
|
92
|
+
public timeout: number | null;
|
|
93
|
+
public maxFreeSockets: number;
|
|
94
|
+
public maxTotalSockets: number;
|
|
95
|
+
public maxSockets: number;
|
|
96
|
+
public sockets: {
|
|
97
|
+
[key: string]: net.Socket[];
|
|
98
|
+
};
|
|
99
|
+
public freeSockets: {
|
|
100
|
+
[key: string]: net.Socket[];
|
|
101
|
+
};
|
|
102
|
+
public requests: {
|
|
103
|
+
[key: string]: http.IncomingMessage[];
|
|
104
|
+
};
|
|
105
|
+
public options: https.AgentOptions;
|
|
106
|
+
private promisifiedCallback?: createAgent.AgentCallbackPromise;
|
|
107
|
+
private explicitDefaultPort?: number;
|
|
108
|
+
private explicitProtocol?: string;
|
|
109
|
+
|
|
110
|
+
constructor(
|
|
111
|
+
callback?: createAgent.AgentCallback | createAgent.AgentOptions,
|
|
112
|
+
_opts?: createAgent.AgentOptions
|
|
113
|
+
) {
|
|
114
|
+
super();
|
|
115
|
+
|
|
116
|
+
let opts = _opts;
|
|
117
|
+
if (typeof callback === 'function') {
|
|
118
|
+
this.callback = callback;
|
|
119
|
+
} else if (callback) {
|
|
120
|
+
opts = callback;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Timeout for the socket to be returned from the callback
|
|
124
|
+
this.timeout = null;
|
|
125
|
+
if (opts && typeof opts.timeout === 'number') {
|
|
126
|
+
this.timeout = opts.timeout;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// These aren't actually used by `agent-base`, but are required
|
|
130
|
+
// for the TypeScript definition files in `@types/node` :/
|
|
131
|
+
this.maxFreeSockets = 1;
|
|
132
|
+
this.maxSockets = 1;
|
|
133
|
+
this.maxTotalSockets = Infinity;
|
|
134
|
+
this.sockets = {};
|
|
135
|
+
this.freeSockets = {};
|
|
136
|
+
this.requests = {};
|
|
137
|
+
this.options = {};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
get defaultPort(): number {
|
|
141
|
+
if (typeof this.explicitDefaultPort === 'number') {
|
|
142
|
+
return this.explicitDefaultPort;
|
|
143
|
+
}
|
|
144
|
+
return isSecureEndpoint() ? 443 : 80;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
set defaultPort(v: number) {
|
|
148
|
+
this.explicitDefaultPort = v;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
get protocol(): string {
|
|
152
|
+
if (typeof this.explicitProtocol === 'string') {
|
|
153
|
+
return this.explicitProtocol;
|
|
154
|
+
}
|
|
155
|
+
return isSecureEndpoint() ? 'https:' : 'http:';
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
set protocol(v: string) {
|
|
159
|
+
this.explicitProtocol = v;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
callback(
|
|
163
|
+
req: createAgent.ClientRequest,
|
|
164
|
+
opts: createAgent.RequestOptions,
|
|
165
|
+
fn: createAgent.AgentCallbackCallback
|
|
166
|
+
): void;
|
|
167
|
+
callback(
|
|
168
|
+
req: createAgent.ClientRequest,
|
|
169
|
+
opts: createAgent.RequestOptions
|
|
170
|
+
):
|
|
171
|
+
| createAgent.AgentCallbackReturn
|
|
172
|
+
| Promise<createAgent.AgentCallbackReturn>;
|
|
173
|
+
callback(
|
|
174
|
+
req: createAgent.ClientRequest,
|
|
175
|
+
opts: createAgent.AgentOptions,
|
|
176
|
+
fn?: createAgent.AgentCallbackCallback
|
|
177
|
+
):
|
|
178
|
+
| createAgent.AgentCallbackReturn
|
|
179
|
+
| Promise<createAgent.AgentCallbackReturn>
|
|
180
|
+
| void {
|
|
181
|
+
throw new Error(
|
|
182
|
+
'"agent-base" has no default implementation, you must subclass and override `callback()`'
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Called by node-core's "_http_client.js" module when creating
|
|
188
|
+
* a new HTTP request with this Agent instance.
|
|
189
|
+
*
|
|
190
|
+
* @api public
|
|
191
|
+
*/
|
|
192
|
+
addRequest(req: ClientRequest, _opts: RequestOptions): void {
|
|
193
|
+
const opts: RequestOptions = { ..._opts };
|
|
194
|
+
|
|
195
|
+
if (typeof opts.secureEndpoint !== 'boolean') {
|
|
196
|
+
opts.secureEndpoint = isSecureEndpoint();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (opts.host == null) {
|
|
200
|
+
opts.host = 'localhost';
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (opts.port == null) {
|
|
204
|
+
opts.port = opts.secureEndpoint ? 443 : 80;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (opts.protocol == null) {
|
|
208
|
+
opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (opts.host && opts.path) {
|
|
212
|
+
// If both a `host` and `path` are specified then it's most
|
|
213
|
+
// likely the result of a `url.parse()` call... we need to
|
|
214
|
+
// remove the `path` portion so that `net.connect()` doesn't
|
|
215
|
+
// attempt to open that as a unix socket file.
|
|
216
|
+
delete opts.path;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
delete opts.agent;
|
|
220
|
+
delete opts.hostname;
|
|
221
|
+
delete opts._defaultAgent;
|
|
222
|
+
delete opts.defaultPort;
|
|
223
|
+
delete opts.createConnection;
|
|
224
|
+
|
|
225
|
+
// Hint to use "Connection: close"
|
|
226
|
+
// XXX: non-documented `http` module API :(
|
|
227
|
+
req._last = true;
|
|
228
|
+
req.shouldKeepAlive = false;
|
|
229
|
+
|
|
230
|
+
let timedOut = false;
|
|
231
|
+
let timeoutId: ReturnType<typeof setTimeout> | null = null;
|
|
232
|
+
const timeoutMs = opts.timeout || this.timeout;
|
|
233
|
+
|
|
234
|
+
const onerror = (err: NodeJS.ErrnoException) => {
|
|
235
|
+
if (req._hadError) return;
|
|
236
|
+
req.emit('error', err);
|
|
237
|
+
// For Safety. Some additional errors might fire later on
|
|
238
|
+
// and we need to make sure we don't double-fire the error event.
|
|
239
|
+
req._hadError = true;
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
const ontimeout = () => {
|
|
243
|
+
timeoutId = null;
|
|
244
|
+
timedOut = true;
|
|
245
|
+
const err: NodeJS.ErrnoException = new Error(
|
|
246
|
+
`A "socket" was not created for HTTP request before ${timeoutMs}ms`
|
|
247
|
+
);
|
|
248
|
+
err.code = 'ETIMEOUT';
|
|
249
|
+
onerror(err);
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
const callbackError = (err: NodeJS.ErrnoException) => {
|
|
253
|
+
if (timedOut) return;
|
|
254
|
+
if (timeoutId !== null) {
|
|
255
|
+
clearTimeout(timeoutId);
|
|
256
|
+
timeoutId = null;
|
|
257
|
+
}
|
|
258
|
+
onerror(err);
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
const onsocket = (socket: AgentCallbackReturn) => {
|
|
262
|
+
if (timedOut) return;
|
|
263
|
+
if (timeoutId != null) {
|
|
264
|
+
clearTimeout(timeoutId);
|
|
265
|
+
timeoutId = null;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (isAgent(socket)) {
|
|
269
|
+
// `socket` is actually an `http.Agent` instance, so
|
|
270
|
+
// relinquish responsibility for this `req` to the Agent
|
|
271
|
+
// from here on
|
|
272
|
+
debug(
|
|
273
|
+
'Callback returned another Agent instance %o',
|
|
274
|
+
socket.constructor.name
|
|
275
|
+
);
|
|
276
|
+
(socket as createAgent.Agent).addRequest(req, opts);
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (socket) {
|
|
281
|
+
socket.once('free', () => {
|
|
282
|
+
this.freeSocket(socket as net.Socket, opts);
|
|
283
|
+
});
|
|
284
|
+
req.onSocket(socket as net.Socket);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const err = new Error(
|
|
289
|
+
`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``
|
|
290
|
+
);
|
|
291
|
+
onerror(err);
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
if (typeof this.callback !== 'function') {
|
|
295
|
+
onerror(new Error('`callback` is not defined'));
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (!this.promisifiedCallback) {
|
|
300
|
+
if (this.callback.length >= 3) {
|
|
301
|
+
debug('Converting legacy callback function to promise');
|
|
302
|
+
this.promisifiedCallback = promisify(this.callback);
|
|
303
|
+
} else {
|
|
304
|
+
this.promisifiedCallback = this.callback;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (typeof timeoutMs === 'number' && timeoutMs > 0) {
|
|
309
|
+
timeoutId = setTimeout(ontimeout, timeoutMs);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
if ('port' in opts && typeof opts.port !== 'number') {
|
|
313
|
+
opts.port = Number(opts.port);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
try {
|
|
317
|
+
debug(
|
|
318
|
+
'Resolving socket for %o request: %o',
|
|
319
|
+
opts.protocol,
|
|
320
|
+
`${req.method} ${req.path}`
|
|
321
|
+
);
|
|
322
|
+
Promise.resolve(this.promisifiedCallback(req, opts)).then(
|
|
323
|
+
onsocket,
|
|
324
|
+
callbackError
|
|
325
|
+
);
|
|
326
|
+
} catch (err) {
|
|
327
|
+
Promise.reject(err).catch(callbackError);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
freeSocket(socket: net.Socket, opts: AgentOptions) {
|
|
332
|
+
debug('Freeing socket %o %o', socket.constructor.name, opts);
|
|
333
|
+
socket.destroy();
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
destroy() {
|
|
337
|
+
debug('Destroying agent %o', this.constructor.name);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// So that `instanceof` works correctly
|
|
342
|
+
createAgent.prototype = createAgent.Agent.prototype;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export = createAgent;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Agent,
|
|
3
|
+
ClientRequest,
|
|
4
|
+
RequestOptions,
|
|
5
|
+
AgentCallbackCallback,
|
|
6
|
+
AgentCallbackPromise,
|
|
7
|
+
AgentCallbackReturn
|
|
8
|
+
} from './index';
|
|
9
|
+
|
|
10
|
+
type LegacyCallback = (
|
|
11
|
+
req: ClientRequest,
|
|
12
|
+
opts: RequestOptions,
|
|
13
|
+
fn: AgentCallbackCallback
|
|
14
|
+
) => void;
|
|
15
|
+
|
|
16
|
+
export default function promisify(fn: LegacyCallback): AgentCallbackPromise {
|
|
17
|
+
return function(this: Agent, req: ClientRequest, opts: RequestOptions) {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
fn.call(
|
|
20
|
+
this,
|
|
21
|
+
req,
|
|
22
|
+
opts,
|
|
23
|
+
(err: Error | null | undefined, rtn?: AgentCallbackReturn) => {
|
|
24
|
+
if (err) {
|
|
25
|
+
reject(err);
|
|
26
|
+
} else {
|
|
27
|
+
resolve(rtn);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
https-proxy-agent
|
|
2
|
+
================
|
|
3
|
+
### An HTTP(s) proxy `http.Agent` implementation for HTTPS
|
|
4
|
+
[](https://github.com/TooTallNate/node-https-proxy-agent/actions?workflow=Node+CI)
|
|
5
|
+
|
|
6
|
+
This module provides an `http.Agent` implementation that connects to a specified
|
|
7
|
+
HTTP or HTTPS proxy server, and can be used with the built-in `https` module.
|
|
8
|
+
|
|
9
|
+
Specifically, this `Agent` implementation connects to an intermediary "proxy"
|
|
10
|
+
server and issues the [CONNECT HTTP method][CONNECT], which tells the proxy to
|
|
11
|
+
open a direct TCP connection to the destination server.
|
|
12
|
+
|
|
13
|
+
Since this agent implements the CONNECT HTTP method, it also works with other
|
|
14
|
+
protocols that use this method when connecting over proxies (i.e. WebSockets).
|
|
15
|
+
See the "Examples" section below for more.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Installation
|
|
19
|
+
------------
|
|
20
|
+
|
|
21
|
+
Install with `npm`:
|
|
22
|
+
|
|
23
|
+
``` bash
|
|
24
|
+
$ npm install https-proxy-agent
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
Examples
|
|
29
|
+
--------
|
|
30
|
+
|
|
31
|
+
#### `https` module example
|
|
32
|
+
|
|
33
|
+
``` js
|
|
34
|
+
var url = require('url');
|
|
35
|
+
var https = require('https');
|
|
36
|
+
var HttpsProxyAgent = require('https-proxy-agent');
|
|
37
|
+
|
|
38
|
+
// HTTP/HTTPS proxy to connect to
|
|
39
|
+
var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
|
|
40
|
+
console.log('using proxy server %j', proxy);
|
|
41
|
+
|
|
42
|
+
// HTTPS endpoint for the proxy to connect to
|
|
43
|
+
var endpoint = process.argv[2] || 'https://graph.facebook.com/tootallnate';
|
|
44
|
+
console.log('attempting to GET %j', endpoint);
|
|
45
|
+
var options = url.parse(endpoint);
|
|
46
|
+
|
|
47
|
+
// create an instance of the `HttpsProxyAgent` class with the proxy server information
|
|
48
|
+
var agent = new HttpsProxyAgent(proxy);
|
|
49
|
+
options.agent = agent;
|
|
50
|
+
|
|
51
|
+
https.get(options, function (res) {
|
|
52
|
+
console.log('"response" event!', res.headers);
|
|
53
|
+
res.pipe(process.stdout);
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### `ws` WebSocket connection example
|
|
58
|
+
|
|
59
|
+
``` js
|
|
60
|
+
var url = require('url');
|
|
61
|
+
var WebSocket = require('ws');
|
|
62
|
+
var HttpsProxyAgent = require('https-proxy-agent');
|
|
63
|
+
|
|
64
|
+
// HTTP/HTTPS proxy to connect to
|
|
65
|
+
var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
|
|
66
|
+
console.log('using proxy server %j', proxy);
|
|
67
|
+
|
|
68
|
+
// WebSocket endpoint for the proxy to connect to
|
|
69
|
+
var endpoint = process.argv[2] || 'ws://echo.websocket.org';
|
|
70
|
+
var parsed = url.parse(endpoint);
|
|
71
|
+
console.log('attempting to connect to WebSocket %j', endpoint);
|
|
72
|
+
|
|
73
|
+
// create an instance of the `HttpsProxyAgent` class with the proxy server information
|
|
74
|
+
var options = url.parse(proxy);
|
|
75
|
+
|
|
76
|
+
var agent = new HttpsProxyAgent(options);
|
|
77
|
+
|
|
78
|
+
// finally, initiate the WebSocket connection
|
|
79
|
+
var socket = new WebSocket(endpoint, { agent: agent });
|
|
80
|
+
|
|
81
|
+
socket.on('open', function () {
|
|
82
|
+
console.log('"open" event!');
|
|
83
|
+
socket.send('hello world');
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
socket.on('message', function (data, flags) {
|
|
87
|
+
console.log('"message" event! %j %j', data, flags);
|
|
88
|
+
socket.close();
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
API
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### new HttpsProxyAgent(Object options)
|
|
96
|
+
|
|
97
|
+
The `HttpsProxyAgent` class implements an `http.Agent` subclass that connects
|
|
98
|
+
to the specified "HTTP(s) proxy server" in order to proxy HTTPS and/or WebSocket
|
|
99
|
+
requests. This is achieved by using the [HTTP `CONNECT` method][CONNECT].
|
|
100
|
+
|
|
101
|
+
The `options` argument may either be a string URI of the proxy server to use, or an
|
|
102
|
+
"options" object with more specific properties:
|
|
103
|
+
|
|
104
|
+
* `host` - String - Proxy host to connect to (may use `hostname` as well). Required.
|
|
105
|
+
* `port` - Number - Proxy port to connect to. Required.
|
|
106
|
+
* `protocol` - String - If `https:`, then use TLS to connect to the proxy.
|
|
107
|
+
* `headers` - Object - Additional HTTP headers to be sent on the HTTP CONNECT method.
|
|
108
|
+
* Any other options given are passed to the `net.connect()`/`tls.connect()` functions.
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
License
|
|
112
|
+
-------
|
|
113
|
+
|
|
114
|
+
(The MIT License)
|
|
115
|
+
|
|
116
|
+
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
|
|
117
|
+
|
|
118
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
119
|
+
a copy of this software and associated documentation files (the
|
|
120
|
+
'Software'), to deal in the Software without restriction, including
|
|
121
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
122
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
123
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
124
|
+
the following conditions:
|
|
125
|
+
|
|
126
|
+
The above copyright notice and this permission notice shall be
|
|
127
|
+
included in all copies or substantial portions of the Software.
|
|
128
|
+
|
|
129
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
130
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
131
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
132
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
133
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
134
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
135
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
136
|
+
|
|
137
|
+
[CONNECT]: http://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_Tunneling
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import net from 'net';
|
|
3
|
+
import { Agent, ClientRequest, RequestOptions } from 'agent-base';
|
|
4
|
+
import { HttpsProxyAgentOptions } from '.';
|
|
5
|
+
/**
|
|
6
|
+
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
|
|
7
|
+
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
|
|
8
|
+
*
|
|
9
|
+
* Outgoing HTTP requests are first tunneled through the proxy server using the
|
|
10
|
+
* `CONNECT` HTTP request method to establish a connection to the proxy server,
|
|
11
|
+
* and then the proxy server connects to the destination target and issues the
|
|
12
|
+
* HTTP request from the proxy server.
|
|
13
|
+
*
|
|
14
|
+
* `https:` requests have their socket connection upgraded to TLS once
|
|
15
|
+
* the connection to the proxy server has been established.
|
|
16
|
+
*
|
|
17
|
+
* @api public
|
|
18
|
+
*/
|
|
19
|
+
export default class HttpsProxyAgent extends Agent {
|
|
20
|
+
private secureProxy;
|
|
21
|
+
private proxy;
|
|
22
|
+
constructor(_opts: string | HttpsProxyAgentOptions);
|
|
23
|
+
/**
|
|
24
|
+
* Called when the node-core HTTP client library is creating a
|
|
25
|
+
* new HTTP request.
|
|
26
|
+
*
|
|
27
|
+
* @api protected
|
|
28
|
+
*/
|
|
29
|
+
callback(req: ClientRequest, opts: RequestOptions): Promise<net.Socket>;
|
|
30
|
+
}
|