modelmix 2.3.2 → 2.3.8
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/README.md +18 -5
- package/demo/demo.mjs +17 -6
- package/demo/node_modules/.package-lock.json +254 -0
- package/demo/node_modules/@anthropic-ai/sdk/CHANGELOG.md +859 -0
- package/demo/node_modules/@anthropic-ai/sdk/LICENSE +8 -0
- package/demo/node_modules/@anthropic-ai/sdk/README.md +424 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.d.ts +9 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.js +16 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.mjs +12 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/README.md +46 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.d.ts +5 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.js +21 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.mjs +2 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.d.ts +5 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.js +21 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.mjs +2 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.d.ts +5 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.js +21 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.mjs +2 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.d.ts +5 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.js +21 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.mjs +2 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types.d.ts +101 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types.js +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types.mjs +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.d.ts +6 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.js +14 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.mjs +10 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/index.d.ts +81 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/index.js +13 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/index.mjs +7 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/manual-types.d.ts +12 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/manual-types.js +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/manual-types.mjs +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.d.ts +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.js +90 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.mjs +56 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/node-types.d.ts +42 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/node-types.js +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/node-types.mjs +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.d.ts +37 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.js +41 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.mjs +37 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.d.ts +5 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.js +78 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.mjs +71 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/web-types.d.ts +83 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/web-types.js +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/_shims/web-types.mjs +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/core.d.ts +239 -0
- package/demo/node_modules/@anthropic-ai/sdk/core.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/core.js +879 -0
- package/demo/node_modules/@anthropic-ai/sdk/core.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/core.mjs +848 -0
- package/demo/node_modules/@anthropic-ai/sdk/core.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/error.d.ts +53 -0
- package/demo/node_modules/@anthropic-ai/sdk/error.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/error.js +143 -0
- package/demo/node_modules/@anthropic-ai/sdk/error.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/error.mjs +127 -0
- package/demo/node_modules/@anthropic-ai/sdk/error.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/index.d.mts +147 -0
- package/demo/node_modules/@anthropic-ai/sdk/index.d.ts +147 -0
- package/demo/node_modules/@anthropic-ai/sdk/index.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/index.js +149 -0
- package/demo/node_modules/@anthropic-ai/sdk/index.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/index.mjs +121 -0
- package/demo/node_modules/@anthropic-ai/sdk/index.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts +94 -0
- package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +436 -0
- package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +432 -0
- package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/package.json +104 -0
- package/demo/node_modules/@anthropic-ai/sdk/resource.d.ts +6 -0
- package/demo/node_modules/@anthropic-ai/sdk/resource.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resource.js +11 -0
- package/demo/node_modules/@anthropic-ai/sdk/resource.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resource.mjs +7 -0
- package/demo/node_modules/@anthropic-ai/sdk/resource.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +9 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +40 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +13 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.js +9 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +4 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.d.ts +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.js +9 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.mjs +4 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.d.ts +462 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.js +20 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.mjs +16 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.d.ts +19 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.js +40 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.mjs +13 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/completions.d.ts +184 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/completions.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/completions.js +19 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/completions.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/completions.mjs +15 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/completions.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/index.d.ts +4 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/index.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/index.js +11 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/index.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/index.mjs +5 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/index.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/messages.d.ts +619 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/messages.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/messages.js +28 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/messages.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/messages.mjs +23 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/messages.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts +2 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.js +4 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.mjs +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/node.d.ts +29 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/node.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/node.js +31 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/node.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/node.mjs +5 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/node.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/web.d.ts +26 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/web.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/web.js +31 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/web.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/web.mjs +5 -0
- package/demo/node_modules/@anthropic-ai/sdk/shims/web.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/MultipartBody.ts +9 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/README.md +46 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/runtime-bun.ts +4 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/runtime-node.ts +4 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/runtime.ts +4 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/types-node.ts +4 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/types.d.ts +101 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/types.js +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/types.mjs +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/bun-runtime.ts +14 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/index.d.ts +81 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/index.js +13 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/index.mjs +7 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/manual-types.d.ts +12 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/manual-types.js +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/manual-types.mjs +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/node-runtime.ts +83 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/node-types.d.ts +42 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/node-types.js +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/node-types.mjs +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/registry.ts +67 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/web-runtime.ts +103 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/web-types.d.ts +83 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/web-types.js +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/_shims/web-types.mjs +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/core.ts +1162 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/error.ts +146 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/index.ts +264 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/lib/.keep +4 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +535 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/resource.ts +11 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +12 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +4 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/resources/beta/tools/index.ts +16 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/resources/beta/tools/messages.ts +531 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/resources/beta/tools/tools.ts +22 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/resources/completions.ts +223 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/resources/index.ts +33 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/resources/messages.ts +729 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/resources/top-level.ts +3 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/shims/node.ts +50 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/shims/web.ts +50 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/streaming.ts +509 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/tsconfig.json +11 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/uploads.ts +248 -0
- package/demo/node_modules/@anthropic-ai/sdk/src/version.ts +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/streaming.d.ts +41 -0
- package/demo/node_modules/@anthropic-ai/sdk/streaming.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/streaming.js +431 -0
- package/demo/node_modules/@anthropic-ai/sdk/streaming.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/streaming.mjs +424 -0
- package/demo/node_modules/@anthropic-ai/sdk/streaming.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/uploads.d.ts +75 -0
- package/demo/node_modules/@anthropic-ai/sdk/uploads.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/uploads.js +165 -0
- package/demo/node_modules/@anthropic-ai/sdk/uploads.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/uploads.mjs +152 -0
- package/demo/node_modules/@anthropic-ai/sdk/uploads.mjs.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/version.d.ts +2 -0
- package/demo/node_modules/@anthropic-ai/sdk/version.d.ts.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/version.js +5 -0
- package/demo/node_modules/@anthropic-ai/sdk/version.js.map +1 -0
- package/demo/node_modules/@anthropic-ai/sdk/version.mjs +2 -0
- package/demo/node_modules/@anthropic-ai/sdk/version.mjs.map +1 -0
- package/demo/node_modules/@types/node/LICENSE +21 -0
- package/demo/node_modules/@types/node/README.md +15 -0
- package/demo/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/demo/node_modules/@types/node/assert.d.ts +985 -0
- package/demo/node_modules/@types/node/async_hooks.d.ts +522 -0
- package/demo/node_modules/@types/node/buffer.d.ts +2353 -0
- package/demo/node_modules/@types/node/child_process.d.ts +1544 -0
- package/demo/node_modules/@types/node/cluster.d.ts +578 -0
- package/demo/node_modules/@types/node/console.d.ts +452 -0
- package/demo/node_modules/@types/node/constants.d.ts +19 -0
- package/demo/node_modules/@types/node/crypto.d.ts +4457 -0
- package/demo/node_modules/@types/node/dgram.d.ts +596 -0
- package/demo/node_modules/@types/node/diagnostics_channel.d.ts +546 -0
- package/demo/node_modules/@types/node/dns/promises.d.ts +473 -0
- package/demo/node_modules/@types/node/dns.d.ts +853 -0
- package/demo/node_modules/@types/node/dom-events.d.ts +124 -0
- package/demo/node_modules/@types/node/domain.d.ts +170 -0
- package/demo/node_modules/@types/node/events.d.ts +819 -0
- package/demo/node_modules/@types/node/fs/promises.d.ts +1205 -0
- package/demo/node_modules/@types/node/fs.d.ts +4237 -0
- package/demo/node_modules/@types/node/globals.d.ts +377 -0
- package/demo/node_modules/@types/node/globals.global.d.ts +1 -0
- package/demo/node_modules/@types/node/http.d.ts +1803 -0
- package/demo/node_modules/@types/node/http2.d.ts +2392 -0
- package/demo/node_modules/@types/node/https.d.ts +544 -0
- package/demo/node_modules/@types/node/index.d.ts +88 -0
- package/demo/node_modules/@types/node/inspector.d.ts +2738 -0
- package/demo/node_modules/@types/node/module.d.ts +298 -0
- package/demo/node_modules/@types/node/net.d.ts +918 -0
- package/demo/node_modules/@types/node/os.d.ts +473 -0
- package/demo/node_modules/@types/node/package.json +222 -0
- package/demo/node_modules/@types/node/path.d.ts +191 -0
- package/demo/node_modules/@types/node/perf_hooks.d.ts +626 -0
- package/demo/node_modules/@types/node/process.d.ts +1548 -0
- package/demo/node_modules/@types/node/punycode.d.ts +117 -0
- package/demo/node_modules/@types/node/querystring.d.ts +141 -0
- package/demo/node_modules/@types/node/readline/promises.d.ts +143 -0
- package/demo/node_modules/@types/node/readline.d.ts +666 -0
- package/demo/node_modules/@types/node/repl.d.ts +430 -0
- package/demo/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/demo/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/demo/node_modules/@types/node/stream/web.d.ts +352 -0
- package/demo/node_modules/@types/node/stream.d.ts +1731 -0
- package/demo/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/demo/node_modules/@types/node/test.d.ts +1113 -0
- package/demo/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/demo/node_modules/@types/node/timers.d.ts +126 -0
- package/demo/node_modules/@types/node/tls.d.ts +1203 -0
- package/demo/node_modules/@types/node/trace_events.d.ts +171 -0
- package/demo/node_modules/@types/node/tty.d.ts +206 -0
- package/demo/node_modules/@types/node/url.d.ts +954 -0
- package/demo/node_modules/@types/node/util.d.ts +2075 -0
- package/demo/node_modules/@types/node/v8.d.ts +753 -0
- package/demo/node_modules/@types/node/vm.d.ts +667 -0
- package/demo/node_modules/@types/node/wasi.d.ts +160 -0
- package/demo/node_modules/@types/node/worker_threads.d.ts +692 -0
- package/demo/node_modules/@types/node/zlib.d.ts +517 -0
- package/demo/node_modules/@types/node-fetch/LICENSE +21 -0
- package/demo/node_modules/@types/node-fetch/README.md +15 -0
- package/demo/node_modules/@types/node-fetch/externals.d.ts +32 -0
- package/demo/node_modules/@types/node-fetch/index.d.ts +238 -0
- package/demo/node_modules/@types/node-fetch/package.json +83 -0
- package/demo/node_modules/abort-controller/LICENSE +21 -0
- package/demo/node_modules/abort-controller/README.md +98 -0
- package/demo/node_modules/abort-controller/browser.js +13 -0
- package/demo/node_modules/abort-controller/browser.mjs +11 -0
- package/demo/node_modules/abort-controller/package.json +97 -0
- package/demo/node_modules/abort-controller/polyfill.js +21 -0
- package/demo/node_modules/abort-controller/polyfill.mjs +19 -0
- package/demo/node_modules/agentkeepalive/History.md +268 -0
- package/demo/node_modules/agentkeepalive/LICENSE +23 -0
- package/demo/node_modules/agentkeepalive/README.md +256 -0
- package/demo/node_modules/agentkeepalive/browser.js +5 -0
- package/demo/node_modules/agentkeepalive/index.d.ts +65 -0
- package/demo/node_modules/agentkeepalive/index.js +5 -0
- package/demo/node_modules/agentkeepalive/lib/agent.js +402 -0
- package/demo/node_modules/agentkeepalive/lib/constants.js +14 -0
- package/demo/node_modules/agentkeepalive/lib/https_agent.js +51 -0
- package/demo/node_modules/agentkeepalive/package.json +56 -0
- package/demo/node_modules/asynckit/LICENSE +21 -0
- package/demo/node_modules/asynckit/README.md +233 -0
- package/demo/node_modules/asynckit/bench.js +76 -0
- package/demo/node_modules/asynckit/index.js +6 -0
- package/demo/node_modules/asynckit/lib/abort.js +29 -0
- package/demo/node_modules/asynckit/lib/async.js +34 -0
- package/demo/node_modules/asynckit/lib/defer.js +26 -0
- package/demo/node_modules/asynckit/lib/iterate.js +75 -0
- package/demo/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/demo/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/demo/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/demo/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/demo/node_modules/asynckit/lib/state.js +37 -0
- package/demo/node_modules/asynckit/lib/streamify.js +141 -0
- package/demo/node_modules/asynckit/lib/terminator.js +29 -0
- package/demo/node_modules/asynckit/package.json +63 -0
- package/demo/node_modules/asynckit/parallel.js +43 -0
- package/demo/node_modules/asynckit/serial.js +17 -0
- package/demo/node_modules/asynckit/serialOrdered.js +75 -0
- package/demo/node_modules/asynckit/stream.js +21 -0
- package/demo/node_modules/combined-stream/License +19 -0
- package/demo/node_modules/combined-stream/Readme.md +138 -0
- package/demo/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/demo/node_modules/combined-stream/package.json +25 -0
- package/demo/node_modules/combined-stream/yarn.lock +17 -0
- package/demo/node_modules/delayed-stream/License +19 -0
- package/demo/node_modules/delayed-stream/Makefile +7 -0
- package/demo/node_modules/delayed-stream/Readme.md +141 -0
- package/demo/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/demo/node_modules/delayed-stream/package.json +27 -0
- package/demo/node_modules/dotenv/CHANGELOG.md +475 -0
- package/demo/node_modules/dotenv/LICENSE +23 -0
- package/demo/node_modules/dotenv/README-es.md +448 -0
- package/demo/node_modules/dotenv/README.md +728 -0
- package/demo/node_modules/dotenv/config.d.ts +1 -0
- package/demo/node_modules/dotenv/config.js +9 -0
- package/demo/node_modules/dotenv/lib/cli-options.js +11 -0
- package/demo/node_modules/dotenv/lib/env-options.js +24 -0
- package/demo/node_modules/dotenv/lib/main.d.ts +153 -0
- package/demo/node_modules/dotenv/lib/main.js +361 -0
- package/demo/node_modules/dotenv/package.json +65 -0
- package/demo/node_modules/event-target-shim/LICENSE +22 -0
- package/demo/node_modules/event-target-shim/README.md +293 -0
- package/demo/node_modules/event-target-shim/index.d.ts +399 -0
- package/demo/node_modules/event-target-shim/package.json +82 -0
- package/demo/node_modules/form-data/License +19 -0
- package/demo/node_modules/form-data/README.md.bak +358 -0
- package/demo/node_modules/form-data/Readme.md +358 -0
- package/demo/node_modules/form-data/index.d.ts +62 -0
- package/demo/node_modules/form-data/lib/browser.js +2 -0
- package/demo/node_modules/form-data/lib/form_data.js +501 -0
- package/demo/node_modules/form-data/lib/populate.js +10 -0
- package/demo/node_modules/form-data/package.json +68 -0
- package/demo/node_modules/form-data-encoder/@type/FileLike.d.ts +23 -0
- package/demo/node_modules/form-data-encoder/@type/FormDataEncoder.d.ts +160 -0
- package/demo/node_modules/form-data-encoder/@type/FormDataLike.d.ts +40 -0
- package/demo/node_modules/form-data-encoder/@type/index.d.ts +5 -0
- package/demo/node_modules/form-data-encoder/@type/util/createBoundary.d.ts +13 -0
- package/demo/node_modules/form-data-encoder/@type/util/escapeName.d.ts +11 -0
- package/demo/node_modules/form-data-encoder/@type/util/isFileLike.d.ts +28 -0
- package/demo/node_modules/form-data-encoder/@type/util/isFormData.d.ts +15 -0
- package/demo/node_modules/form-data-encoder/@type/util/isFunction.d.ts +7 -0
- package/demo/node_modules/form-data-encoder/@type/util/isPlainObject.d.ts +2 -0
- package/demo/node_modules/form-data-encoder/@type/util/normalizeValue.d.ts +11 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/FileLike.js +2 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/FormDataEncoder.js +126 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/FormDataLike.js +2 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/index.js +17 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/package.json +3 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/util/createBoundary.js +12 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/util/escapeName.js +7 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/util/isFileLike.js +16 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/util/isFormData.js +16 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/util/isFunction.js +4 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/util/isPlainObject.js +15 -0
- package/demo/node_modules/form-data-encoder/lib/cjs/util/normalizeValue.js +11 -0
- package/demo/node_modules/form-data-encoder/lib/esm/FileLike.js +1 -0
- package/demo/node_modules/form-data-encoder/lib/esm/FormDataEncoder.js +119 -0
- package/demo/node_modules/form-data-encoder/lib/esm/FormDataLike.js +1 -0
- package/demo/node_modules/form-data-encoder/lib/esm/index.js +5 -0
- package/demo/node_modules/form-data-encoder/lib/esm/package.json +3 -0
- package/demo/node_modules/form-data-encoder/lib/esm/util/createBoundary.js +10 -0
- package/demo/node_modules/form-data-encoder/lib/esm/util/escapeName.js +5 -0
- package/demo/node_modules/form-data-encoder/lib/esm/util/isFileLike.js +9 -0
- package/demo/node_modules/form-data-encoder/lib/esm/util/isFormData.js +9 -0
- package/demo/node_modules/form-data-encoder/lib/esm/util/isFunction.js +2 -0
- package/demo/node_modules/form-data-encoder/lib/esm/util/isPlainObject.js +13 -0
- package/demo/node_modules/form-data-encoder/lib/esm/util/normalizeValue.js +9 -0
- package/demo/node_modules/form-data-encoder/license +21 -0
- package/demo/node_modules/form-data-encoder/package.json +63 -0
- package/demo/node_modules/form-data-encoder/readme.md +366 -0
- package/demo/node_modules/formdata-node/@type/Blob.d.ts +66 -0
- package/demo/node_modules/formdata-node/@type/BlobPart.d.ts +2 -0
- package/demo/node_modules/formdata-node/@type/File.d.ts +53 -0
- package/demo/node_modules/formdata-node/@type/FormData.d.ts +105 -0
- package/demo/node_modules/formdata-node/@type/blobHelpers.d.ts +9 -0
- package/demo/node_modules/formdata-node/@type/browser.d.ts +10 -0
- package/demo/node_modules/formdata-node/@type/deprecateConstructorEntries.d.ts +1 -0
- package/demo/node_modules/formdata-node/@type/fileFromPath.d.ts +55 -0
- package/demo/node_modules/formdata-node/@type/index.d.ts +3 -0
- package/demo/node_modules/formdata-node/@type/isBlob.d.ts +2 -0
- package/demo/node_modules/formdata-node/@type/isFile.d.ts +7 -0
- package/demo/node_modules/formdata-node/@type/isFunction.d.ts +1 -0
- package/demo/node_modules/formdata-node/@type/isPlainObject.d.ts +2 -0
- package/demo/node_modules/formdata-node/lib/cjs/Blob.js +122 -0
- package/demo/node_modules/formdata-node/lib/cjs/BlobPart.js +2 -0
- package/demo/node_modules/formdata-node/lib/cjs/File.js +52 -0
- package/demo/node_modules/formdata-node/lib/cjs/FormData.js +148 -0
- package/demo/node_modules/formdata-node/lib/cjs/blobHelpers.js +80 -0
- package/demo/node_modules/formdata-node/lib/cjs/browser.js +13 -0
- package/demo/node_modules/formdata-node/lib/cjs/deprecateConstructorEntries.js +6 -0
- package/demo/node_modules/formdata-node/lib/cjs/fileFromPath.js +97 -0
- package/demo/node_modules/formdata-node/lib/cjs/index.js +15 -0
- package/demo/node_modules/formdata-node/lib/cjs/isBlob.js +6 -0
- package/demo/node_modules/formdata-node/lib/cjs/isFile.js +6 -0
- package/demo/node_modules/formdata-node/lib/cjs/isFunction.js +5 -0
- package/demo/node_modules/formdata-node/lib/cjs/isPlainObject.js +15 -0
- package/demo/node_modules/formdata-node/lib/cjs/package.json +3 -0
- package/demo/node_modules/formdata-node/lib/esm/Blob.js +118 -0
- package/demo/node_modules/formdata-node/lib/esm/BlobPart.js +1 -0
- package/demo/node_modules/formdata-node/lib/esm/File.js +48 -0
- package/demo/node_modules/formdata-node/lib/esm/FormData.js +144 -0
- package/demo/node_modules/formdata-node/lib/esm/blobHelpers.js +75 -0
- package/demo/node_modules/formdata-node/lib/esm/browser.js +10 -0
- package/demo/node_modules/formdata-node/lib/esm/deprecateConstructorEntries.js +3 -0
- package/demo/node_modules/formdata-node/lib/esm/fileFromPath.js +79 -0
- package/demo/node_modules/formdata-node/lib/esm/index.js +3 -0
- package/demo/node_modules/formdata-node/lib/esm/isBlob.js +2 -0
- package/demo/node_modules/formdata-node/lib/esm/isFile.js +2 -0
- package/demo/node_modules/formdata-node/lib/esm/isFunction.js +1 -0
- package/demo/node_modules/formdata-node/lib/esm/isPlainObject.js +13 -0
- package/demo/node_modules/formdata-node/lib/esm/package.json +3 -0
- package/demo/node_modules/formdata-node/lib/node-domexception.d.ts +5 -0
- package/demo/node_modules/formdata-node/license +21 -0
- package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/LICENSE +22 -0
- package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/README.md +135 -0
- package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/es5/package.json +6 -0
- package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/package.json +101 -0
- package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/polyfill/es5/package.json +5 -0
- package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/polyfill/package.json +5 -0
- package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/types/polyfill.d.ts +62 -0
- package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/types/ponyfill.d.ts +775 -0
- package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/types/tsdoc-metadata.json +11 -0
- package/demo/node_modules/formdata-node/package.json +94 -0
- package/demo/node_modules/formdata-node/readme.md +444 -0
- package/demo/node_modules/humanize-ms/History.md +25 -0
- package/demo/node_modules/humanize-ms/LICENSE +17 -0
- package/demo/node_modules/humanize-ms/README.md +40 -0
- package/demo/node_modules/humanize-ms/index.js +24 -0
- package/demo/node_modules/humanize-ms/package.json +37 -0
- package/demo/node_modules/mime-db/HISTORY.md +507 -0
- package/demo/node_modules/mime-db/LICENSE +23 -0
- package/demo/node_modules/mime-db/README.md +100 -0
- package/demo/node_modules/mime-db/db.json +8519 -0
- package/demo/node_modules/mime-db/index.js +12 -0
- package/demo/node_modules/mime-db/package.json +60 -0
- package/demo/node_modules/mime-types/HISTORY.md +397 -0
- package/demo/node_modules/mime-types/LICENSE +23 -0
- package/demo/node_modules/mime-types/README.md +113 -0
- package/demo/node_modules/mime-types/index.js +188 -0
- package/demo/node_modules/mime-types/package.json +44 -0
- package/demo/node_modules/ms/index.js +162 -0
- package/demo/node_modules/ms/license.md +21 -0
- package/demo/node_modules/ms/package.json +38 -0
- package/demo/node_modules/ms/readme.md +59 -0
- package/demo/node_modules/node-domexception/.history/README_20210527203617.md +2 -0
- package/demo/node_modules/node-domexception/.history/README_20210527212714.md +41 -0
- package/demo/node_modules/node-domexception/.history/README_20210527213345.md +36 -0
- package/demo/node_modules/node-domexception/.history/README_20210527213411.md +36 -0
- package/demo/node_modules/node-domexception/.history/README_20210527213803.md +36 -0
- package/demo/node_modules/node-domexception/.history/README_20210527214323.md +38 -0
- package/demo/node_modules/node-domexception/.history/README_20210527214408.md +38 -0
- package/demo/node_modules/node-domexception/.history/index_20210527203842.js +0 -0
- package/demo/node_modules/node-domexception/.history/index_20210527203947.js +8 -0
- package/demo/node_modules/node-domexception/.history/index_20210527204259.js +9 -0
- package/demo/node_modules/node-domexception/.history/index_20210527204418.js +9 -0
- package/demo/node_modules/node-domexception/.history/index_20210527204756.js +11 -0
- package/demo/node_modules/node-domexception/.history/index_20210527204833.js +11 -0
- package/demo/node_modules/node-domexception/.history/index_20210527211208.js +15 -0
- package/demo/node_modules/node-domexception/.history/index_20210527211248.js +15 -0
- package/demo/node_modules/node-domexception/.history/index_20210527212722.js +23 -0
- package/demo/node_modules/node-domexception/.history/index_20210527212731.js +23 -0
- package/demo/node_modules/node-domexception/.history/index_20210527212746.js +15 -0
- package/demo/node_modules/node-domexception/.history/index_20210527212900.js +16 -0
- package/demo/node_modules/node-domexception/.history/index_20210527213022.js +16 -0
- package/demo/node_modules/node-domexception/.history/index_20210527213822.js +16 -0
- package/demo/node_modules/node-domexception/.history/index_20210527213843.js +17 -0
- package/demo/node_modules/node-domexception/.history/index_20210527213852.js +17 -0
- package/demo/node_modules/node-domexception/.history/index_20210527213910.js +16 -0
- package/demo/node_modules/node-domexception/.history/index_20210527214034.js +16 -0
- package/demo/node_modules/node-domexception/.history/index_20210527214643.js +41 -0
- package/demo/node_modules/node-domexception/.history/index_20210527214654.js +41 -0
- package/demo/node_modules/node-domexception/.history/index_20210527214700.js +16 -0
- package/demo/node_modules/node-domexception/.history/package_20210527203733.json +19 -0
- package/demo/node_modules/node-domexception/.history/package_20210527203825.json +16 -0
- package/demo/node_modules/node-domexception/.history/package_20210527204621.json +19 -0
- package/demo/node_modules/node-domexception/.history/package_20210527204913.json +25 -0
- package/demo/node_modules/node-domexception/.history/package_20210527204925.json +25 -0
- package/demo/node_modules/node-domexception/.history/package_20210527205145.json +29 -0
- package/demo/node_modules/node-domexception/.history/package_20210527205156.json +29 -0
- package/demo/node_modules/node-domexception/.history/test_20210527205603.js +0 -0
- package/demo/node_modules/node-domexception/.history/test_20210527205957.js +3 -0
- package/demo/node_modules/node-domexception/.history/test_20210527210021.js +3 -0
- package/demo/node_modules/node-domexception/LICENSE +21 -0
- package/demo/node_modules/node-domexception/README.md +46 -0
- package/demo/node_modules/node-domexception/index.js +16 -0
- package/demo/node_modules/node-domexception/package.json +29 -0
- package/demo/node_modules/node-fetch/LICENSE.md +22 -0
- package/demo/node_modules/node-fetch/README.md +634 -0
- package/demo/node_modules/node-fetch/browser.js +25 -0
- package/demo/node_modules/node-fetch/lib/index.es.js +1777 -0
- package/demo/node_modules/node-fetch/lib/index.js +1787 -0
- package/demo/node_modules/node-fetch/lib/index.mjs +1775 -0
- package/demo/node_modules/node-fetch/package.json +89 -0
- package/demo/node_modules/tr46/index.js +193 -0
- package/demo/node_modules/tr46/lib/.gitkeep +0 -0
- package/demo/node_modules/tr46/lib/mappingTable.json +1 -0
- package/demo/node_modules/tr46/package.json +31 -0
- package/demo/node_modules/undici-types/README.md +6 -0
- package/demo/node_modules/undici-types/agent.d.ts +31 -0
- package/demo/node_modules/undici-types/api.d.ts +43 -0
- package/demo/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/demo/node_modules/undici-types/cache.d.ts +36 -0
- package/demo/node_modules/undici-types/client.d.ts +97 -0
- package/demo/node_modules/undici-types/connector.d.ts +34 -0
- package/demo/node_modules/undici-types/content-type.d.ts +21 -0
- package/demo/node_modules/undici-types/cookies.d.ts +28 -0
- package/demo/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/demo/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/demo/node_modules/undici-types/errors.d.ts +128 -0
- package/demo/node_modules/undici-types/fetch.d.ts +209 -0
- package/demo/node_modules/undici-types/file.d.ts +39 -0
- package/demo/node_modules/undici-types/filereader.d.ts +54 -0
- package/demo/node_modules/undici-types/formdata.d.ts +108 -0
- package/demo/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/demo/node_modules/undici-types/global-origin.d.ts +7 -0
- package/demo/node_modules/undici-types/handlers.d.ts +9 -0
- package/demo/node_modules/undici-types/header.d.ts +4 -0
- package/demo/node_modules/undici-types/index.d.ts +63 -0
- package/demo/node_modules/undici-types/interceptors.d.ts +5 -0
- package/demo/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/demo/node_modules/undici-types/mock-client.d.ts +25 -0
- package/demo/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/demo/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/demo/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/demo/node_modules/undici-types/package.json +55 -0
- package/demo/node_modules/undici-types/patch.d.ts +71 -0
- package/demo/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/demo/node_modules/undici-types/pool.d.ts +28 -0
- package/demo/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/demo/node_modules/undici-types/readable.d.ts +61 -0
- package/demo/node_modules/undici-types/webidl.d.ts +220 -0
- package/demo/node_modules/undici-types/websocket.d.ts +131 -0
- package/demo/node_modules/web-streams-polyfill/LICENSE +22 -0
- package/demo/node_modules/web-streams-polyfill/README.md +110 -0
- package/demo/node_modules/web-streams-polyfill/es2018/package.json +14 -0
- package/demo/node_modules/web-streams-polyfill/es6/package.json +14 -0
- package/demo/node_modules/web-streams-polyfill/package.json +83 -0
- package/demo/node_modules/web-streams-polyfill/ponyfill/es2018/package.json +13 -0
- package/demo/node_modules/web-streams-polyfill/ponyfill/es6/package.json +13 -0
- package/demo/node_modules/web-streams-polyfill/ponyfill/package.json +13 -0
- package/demo/node_modules/webidl-conversions/LICENSE.md +12 -0
- package/demo/node_modules/webidl-conversions/README.md +53 -0
- package/demo/node_modules/webidl-conversions/lib/index.js +189 -0
- package/demo/node_modules/webidl-conversions/package.json +23 -0
- package/demo/node_modules/whatwg-url/LICENSE.txt +21 -0
- package/demo/node_modules/whatwg-url/README.md +67 -0
- package/demo/node_modules/whatwg-url/lib/URL-impl.js +200 -0
- package/demo/node_modules/whatwg-url/lib/URL.js +196 -0
- package/demo/node_modules/whatwg-url/lib/public-api.js +11 -0
- package/demo/node_modules/whatwg-url/lib/url-state-machine.js +1297 -0
- package/demo/node_modules/whatwg-url/lib/utils.js +20 -0
- package/demo/node_modules/whatwg-url/package.json +32 -0
- package/demo/prompt.md +25 -0
- package/index.js +83 -1
- package/package.json +4 -3
- package/demo/watson.jpg +0 -0
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const OriginalAgent = require('http').Agent;
|
|
4
|
+
const ms = require('humanize-ms');
|
|
5
|
+
const debug = require('util').debuglog('agentkeepalive');
|
|
6
|
+
const {
|
|
7
|
+
INIT_SOCKET,
|
|
8
|
+
CURRENT_ID,
|
|
9
|
+
CREATE_ID,
|
|
10
|
+
SOCKET_CREATED_TIME,
|
|
11
|
+
SOCKET_NAME,
|
|
12
|
+
SOCKET_REQUEST_COUNT,
|
|
13
|
+
SOCKET_REQUEST_FINISHED_COUNT,
|
|
14
|
+
} = require('./constants');
|
|
15
|
+
|
|
16
|
+
// OriginalAgent come from
|
|
17
|
+
// - https://github.com/nodejs/node/blob/v8.12.0/lib/_http_agent.js
|
|
18
|
+
// - https://github.com/nodejs/node/blob/v10.12.0/lib/_http_agent.js
|
|
19
|
+
|
|
20
|
+
// node <= 10
|
|
21
|
+
let defaultTimeoutListenerCount = 1;
|
|
22
|
+
const majorVersion = parseInt(process.version.split('.', 1)[0].substring(1));
|
|
23
|
+
if (majorVersion >= 11 && majorVersion <= 12) {
|
|
24
|
+
defaultTimeoutListenerCount = 2;
|
|
25
|
+
} else if (majorVersion >= 13) {
|
|
26
|
+
defaultTimeoutListenerCount = 3;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function deprecate(message) {
|
|
30
|
+
console.log('[agentkeepalive:deprecated] %s', message);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
class Agent extends OriginalAgent {
|
|
34
|
+
constructor(options) {
|
|
35
|
+
options = options || {};
|
|
36
|
+
options.keepAlive = options.keepAlive !== false;
|
|
37
|
+
// default is keep-alive and 4s free socket timeout
|
|
38
|
+
// see https://medium.com/ssense-tech/reduce-networking-errors-in-nodejs-23b4eb9f2d83
|
|
39
|
+
if (options.freeSocketTimeout === undefined) {
|
|
40
|
+
options.freeSocketTimeout = 4000;
|
|
41
|
+
}
|
|
42
|
+
// Legacy API: keepAliveTimeout should be rename to `freeSocketTimeout`
|
|
43
|
+
if (options.keepAliveTimeout) {
|
|
44
|
+
deprecate('options.keepAliveTimeout is deprecated, please use options.freeSocketTimeout instead');
|
|
45
|
+
options.freeSocketTimeout = options.keepAliveTimeout;
|
|
46
|
+
delete options.keepAliveTimeout;
|
|
47
|
+
}
|
|
48
|
+
// Legacy API: freeSocketKeepAliveTimeout should be rename to `freeSocketTimeout`
|
|
49
|
+
if (options.freeSocketKeepAliveTimeout) {
|
|
50
|
+
deprecate('options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead');
|
|
51
|
+
options.freeSocketTimeout = options.freeSocketKeepAliveTimeout;
|
|
52
|
+
delete options.freeSocketKeepAliveTimeout;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Sets the socket to timeout after timeout milliseconds of inactivity on the socket.
|
|
56
|
+
// By default is double free socket timeout.
|
|
57
|
+
if (options.timeout === undefined) {
|
|
58
|
+
// make sure socket default inactivity timeout >= 8s
|
|
59
|
+
options.timeout = Math.max(options.freeSocketTimeout * 2, 8000);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// support humanize format
|
|
63
|
+
options.timeout = ms(options.timeout);
|
|
64
|
+
options.freeSocketTimeout = ms(options.freeSocketTimeout);
|
|
65
|
+
options.socketActiveTTL = options.socketActiveTTL ? ms(options.socketActiveTTL) : 0;
|
|
66
|
+
|
|
67
|
+
super(options);
|
|
68
|
+
|
|
69
|
+
this[CURRENT_ID] = 0;
|
|
70
|
+
|
|
71
|
+
// create socket success counter
|
|
72
|
+
this.createSocketCount = 0;
|
|
73
|
+
this.createSocketCountLastCheck = 0;
|
|
74
|
+
|
|
75
|
+
this.createSocketErrorCount = 0;
|
|
76
|
+
this.createSocketErrorCountLastCheck = 0;
|
|
77
|
+
|
|
78
|
+
this.closeSocketCount = 0;
|
|
79
|
+
this.closeSocketCountLastCheck = 0;
|
|
80
|
+
|
|
81
|
+
// socket error event count
|
|
82
|
+
this.errorSocketCount = 0;
|
|
83
|
+
this.errorSocketCountLastCheck = 0;
|
|
84
|
+
|
|
85
|
+
// request finished counter
|
|
86
|
+
this.requestCount = 0;
|
|
87
|
+
this.requestCountLastCheck = 0;
|
|
88
|
+
|
|
89
|
+
// including free socket timeout counter
|
|
90
|
+
this.timeoutSocketCount = 0;
|
|
91
|
+
this.timeoutSocketCountLastCheck = 0;
|
|
92
|
+
|
|
93
|
+
this.on('free', socket => {
|
|
94
|
+
// https://github.com/nodejs/node/pull/32000
|
|
95
|
+
// Node.js native agent will check socket timeout eqs agent.options.timeout.
|
|
96
|
+
// Use the ttl or freeSocketTimeout to overwrite.
|
|
97
|
+
const timeout = this.calcSocketTimeout(socket);
|
|
98
|
+
if (timeout > 0 && socket.timeout !== timeout) {
|
|
99
|
+
socket.setTimeout(timeout);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
get freeSocketKeepAliveTimeout() {
|
|
105
|
+
deprecate('agent.freeSocketKeepAliveTimeout is deprecated, please use agent.options.freeSocketTimeout instead');
|
|
106
|
+
return this.options.freeSocketTimeout;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
get timeout() {
|
|
110
|
+
deprecate('agent.timeout is deprecated, please use agent.options.timeout instead');
|
|
111
|
+
return this.options.timeout;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
get socketActiveTTL() {
|
|
115
|
+
deprecate('agent.socketActiveTTL is deprecated, please use agent.options.socketActiveTTL instead');
|
|
116
|
+
return this.options.socketActiveTTL;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
calcSocketTimeout(socket) {
|
|
120
|
+
/**
|
|
121
|
+
* return <= 0: should free socket
|
|
122
|
+
* return > 0: should update socket timeout
|
|
123
|
+
* return undefined: not find custom timeout
|
|
124
|
+
*/
|
|
125
|
+
let freeSocketTimeout = this.options.freeSocketTimeout;
|
|
126
|
+
const socketActiveTTL = this.options.socketActiveTTL;
|
|
127
|
+
if (socketActiveTTL) {
|
|
128
|
+
// check socketActiveTTL
|
|
129
|
+
const aliveTime = Date.now() - socket[SOCKET_CREATED_TIME];
|
|
130
|
+
const diff = socketActiveTTL - aliveTime;
|
|
131
|
+
if (diff <= 0) {
|
|
132
|
+
return diff;
|
|
133
|
+
}
|
|
134
|
+
if (freeSocketTimeout && diff < freeSocketTimeout) {
|
|
135
|
+
freeSocketTimeout = diff;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// set freeSocketTimeout
|
|
139
|
+
if (freeSocketTimeout) {
|
|
140
|
+
// set free keepalive timer
|
|
141
|
+
// try to use socket custom freeSocketTimeout first, support headers['keep-alive']
|
|
142
|
+
// https://github.com/node-modules/urllib/blob/b76053020923f4d99a1c93cf2e16e0c5ba10bacf/lib/urllib.js#L498
|
|
143
|
+
const customFreeSocketTimeout = socket.freeSocketTimeout || socket.freeSocketKeepAliveTimeout;
|
|
144
|
+
return customFreeSocketTimeout || freeSocketTimeout;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
keepSocketAlive(socket) {
|
|
149
|
+
const result = super.keepSocketAlive(socket);
|
|
150
|
+
// should not keepAlive, do nothing
|
|
151
|
+
if (!result) return result;
|
|
152
|
+
|
|
153
|
+
const customTimeout = this.calcSocketTimeout(socket);
|
|
154
|
+
if (typeof customTimeout === 'undefined') {
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
if (customTimeout <= 0) {
|
|
158
|
+
debug('%s(requests: %s, finished: %s) free but need to destroy by TTL, request count %s, diff is %s',
|
|
159
|
+
socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], customTimeout);
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
if (socket.timeout !== customTimeout) {
|
|
163
|
+
socket.setTimeout(customTimeout);
|
|
164
|
+
}
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// only call on addRequest
|
|
169
|
+
reuseSocket(...args) {
|
|
170
|
+
// reuseSocket(socket, req)
|
|
171
|
+
super.reuseSocket(...args);
|
|
172
|
+
const socket = args[0];
|
|
173
|
+
const req = args[1];
|
|
174
|
+
req.reusedSocket = true;
|
|
175
|
+
const agentTimeout = this.options.timeout;
|
|
176
|
+
if (getSocketTimeout(socket) !== agentTimeout) {
|
|
177
|
+
// reset timeout before use
|
|
178
|
+
socket.setTimeout(agentTimeout);
|
|
179
|
+
debug('%s reset timeout to %sms', socket[SOCKET_NAME], agentTimeout);
|
|
180
|
+
}
|
|
181
|
+
socket[SOCKET_REQUEST_COUNT]++;
|
|
182
|
+
debug('%s(requests: %s, finished: %s) reuse on addRequest, timeout %sms',
|
|
183
|
+
socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT],
|
|
184
|
+
getSocketTimeout(socket));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
[CREATE_ID]() {
|
|
188
|
+
const id = this[CURRENT_ID]++;
|
|
189
|
+
if (this[CURRENT_ID] === Number.MAX_SAFE_INTEGER) this[CURRENT_ID] = 0;
|
|
190
|
+
return id;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
[INIT_SOCKET](socket, options) {
|
|
194
|
+
// bugfix here.
|
|
195
|
+
// https on node 8, 10 won't set agent.options.timeout by default
|
|
196
|
+
// TODO: need to fix on node itself
|
|
197
|
+
if (options.timeout) {
|
|
198
|
+
const timeout = getSocketTimeout(socket);
|
|
199
|
+
if (!timeout) {
|
|
200
|
+
socket.setTimeout(options.timeout);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (this.options.keepAlive) {
|
|
205
|
+
// Disable Nagle's algorithm: http://blog.caustik.com/2012/04/08/scaling-node-js-to-100k-concurrent-connections/
|
|
206
|
+
// https://fengmk2.com/benchmark/nagle-algorithm-delayed-ack-mock.html
|
|
207
|
+
socket.setNoDelay(true);
|
|
208
|
+
}
|
|
209
|
+
this.createSocketCount++;
|
|
210
|
+
if (this.options.socketActiveTTL) {
|
|
211
|
+
socket[SOCKET_CREATED_TIME] = Date.now();
|
|
212
|
+
}
|
|
213
|
+
// don't show the hole '-----BEGIN CERTIFICATE----' key string
|
|
214
|
+
socket[SOCKET_NAME] = `sock[${this[CREATE_ID]()}#${options._agentKey}]`.split('-----BEGIN', 1)[0];
|
|
215
|
+
socket[SOCKET_REQUEST_COUNT] = 1;
|
|
216
|
+
socket[SOCKET_REQUEST_FINISHED_COUNT] = 0;
|
|
217
|
+
installListeners(this, socket, options);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
createConnection(options, oncreate) {
|
|
221
|
+
let called = false;
|
|
222
|
+
const onNewCreate = (err, socket) => {
|
|
223
|
+
if (called) return;
|
|
224
|
+
called = true;
|
|
225
|
+
|
|
226
|
+
if (err) {
|
|
227
|
+
this.createSocketErrorCount++;
|
|
228
|
+
return oncreate(err);
|
|
229
|
+
}
|
|
230
|
+
this[INIT_SOCKET](socket, options);
|
|
231
|
+
oncreate(err, socket);
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
const newSocket = super.createConnection(options, onNewCreate);
|
|
235
|
+
if (newSocket) onNewCreate(null, newSocket);
|
|
236
|
+
return newSocket;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
get statusChanged() {
|
|
240
|
+
const changed = this.createSocketCount !== this.createSocketCountLastCheck ||
|
|
241
|
+
this.createSocketErrorCount !== this.createSocketErrorCountLastCheck ||
|
|
242
|
+
this.closeSocketCount !== this.closeSocketCountLastCheck ||
|
|
243
|
+
this.errorSocketCount !== this.errorSocketCountLastCheck ||
|
|
244
|
+
this.timeoutSocketCount !== this.timeoutSocketCountLastCheck ||
|
|
245
|
+
this.requestCount !== this.requestCountLastCheck;
|
|
246
|
+
if (changed) {
|
|
247
|
+
this.createSocketCountLastCheck = this.createSocketCount;
|
|
248
|
+
this.createSocketErrorCountLastCheck = this.createSocketErrorCount;
|
|
249
|
+
this.closeSocketCountLastCheck = this.closeSocketCount;
|
|
250
|
+
this.errorSocketCountLastCheck = this.errorSocketCount;
|
|
251
|
+
this.timeoutSocketCountLastCheck = this.timeoutSocketCount;
|
|
252
|
+
this.requestCountLastCheck = this.requestCount;
|
|
253
|
+
}
|
|
254
|
+
return changed;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
getCurrentStatus() {
|
|
258
|
+
return {
|
|
259
|
+
createSocketCount: this.createSocketCount,
|
|
260
|
+
createSocketErrorCount: this.createSocketErrorCount,
|
|
261
|
+
closeSocketCount: this.closeSocketCount,
|
|
262
|
+
errorSocketCount: this.errorSocketCount,
|
|
263
|
+
timeoutSocketCount: this.timeoutSocketCount,
|
|
264
|
+
requestCount: this.requestCount,
|
|
265
|
+
freeSockets: inspect(this.freeSockets),
|
|
266
|
+
sockets: inspect(this.sockets),
|
|
267
|
+
requests: inspect(this.requests),
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// node 8 don't has timeout attribute on socket
|
|
273
|
+
// https://github.com/nodejs/node/pull/21204/files#diff-e6ef024c3775d787c38487a6309e491dR408
|
|
274
|
+
function getSocketTimeout(socket) {
|
|
275
|
+
return socket.timeout || socket._idleTimeout;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function installListeners(agent, socket, options) {
|
|
279
|
+
debug('%s create, timeout %sms', socket[SOCKET_NAME], getSocketTimeout(socket));
|
|
280
|
+
|
|
281
|
+
// listener socket events: close, timeout, error, free
|
|
282
|
+
function onFree() {
|
|
283
|
+
// create and socket.emit('free') logic
|
|
284
|
+
// https://github.com/nodejs/node/blob/master/lib/_http_agent.js#L311
|
|
285
|
+
// no req on the socket, it should be the new socket
|
|
286
|
+
if (!socket._httpMessage && socket[SOCKET_REQUEST_COUNT] === 1) return;
|
|
287
|
+
|
|
288
|
+
socket[SOCKET_REQUEST_FINISHED_COUNT]++;
|
|
289
|
+
agent.requestCount++;
|
|
290
|
+
debug('%s(requests: %s, finished: %s) free',
|
|
291
|
+
socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT]);
|
|
292
|
+
|
|
293
|
+
// should reuse on pedding requests?
|
|
294
|
+
const name = agent.getName(options);
|
|
295
|
+
if (socket.writable && agent.requests[name] && agent.requests[name].length) {
|
|
296
|
+
// will be reuse on agent free listener
|
|
297
|
+
socket[SOCKET_REQUEST_COUNT]++;
|
|
298
|
+
debug('%s(requests: %s, finished: %s) will be reuse on agent free event',
|
|
299
|
+
socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT]);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
socket.on('free', onFree);
|
|
303
|
+
|
|
304
|
+
function onClose(isError) {
|
|
305
|
+
debug('%s(requests: %s, finished: %s) close, isError: %s',
|
|
306
|
+
socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], isError);
|
|
307
|
+
agent.closeSocketCount++;
|
|
308
|
+
}
|
|
309
|
+
socket.on('close', onClose);
|
|
310
|
+
|
|
311
|
+
// start socket timeout handler
|
|
312
|
+
function onTimeout() {
|
|
313
|
+
// onTimeout and emitRequestTimeout(_http_client.js)
|
|
314
|
+
// https://github.com/nodejs/node/blob/v12.x/lib/_http_client.js#L711
|
|
315
|
+
const listenerCount = socket.listeners('timeout').length;
|
|
316
|
+
// node <= 10, default listenerCount is 1, onTimeout
|
|
317
|
+
// 11 < node <= 12, default listenerCount is 2, onTimeout and emitRequestTimeout
|
|
318
|
+
// node >= 13, default listenerCount is 3, onTimeout,
|
|
319
|
+
// onTimeout(https://github.com/nodejs/node/pull/32000/files#diff-5f7fb0850412c6be189faeddea6c5359R333)
|
|
320
|
+
// and emitRequestTimeout
|
|
321
|
+
const timeout = getSocketTimeout(socket);
|
|
322
|
+
const req = socket._httpMessage;
|
|
323
|
+
const reqTimeoutListenerCount = req && req.listeners('timeout').length || 0;
|
|
324
|
+
debug('%s(requests: %s, finished: %s) timeout after %sms, listeners %s, defaultTimeoutListenerCount %s, hasHttpRequest %s, HttpRequest timeoutListenerCount %s',
|
|
325
|
+
socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT],
|
|
326
|
+
timeout, listenerCount, defaultTimeoutListenerCount, !!req, reqTimeoutListenerCount);
|
|
327
|
+
if (debug.enabled) {
|
|
328
|
+
debug('timeout listeners: %s', socket.listeners('timeout').map(f => f.name).join(', '));
|
|
329
|
+
}
|
|
330
|
+
agent.timeoutSocketCount++;
|
|
331
|
+
const name = agent.getName(options);
|
|
332
|
+
if (agent.freeSockets[name] && agent.freeSockets[name].indexOf(socket) !== -1) {
|
|
333
|
+
// free socket timeout, destroy quietly
|
|
334
|
+
socket.destroy();
|
|
335
|
+
// Remove it from freeSockets list immediately to prevent new requests
|
|
336
|
+
// from being sent through this socket.
|
|
337
|
+
agent.removeSocket(socket, options);
|
|
338
|
+
debug('%s is free, destroy quietly', socket[SOCKET_NAME]);
|
|
339
|
+
} else {
|
|
340
|
+
// if there is no any request socket timeout handler,
|
|
341
|
+
// agent need to handle socket timeout itself.
|
|
342
|
+
//
|
|
343
|
+
// custom request socket timeout handle logic must follow these rules:
|
|
344
|
+
// 1. Destroy socket first
|
|
345
|
+
// 2. Must emit socket 'agentRemove' event tell agent remove socket
|
|
346
|
+
// from freeSockets list immediately.
|
|
347
|
+
// Otherise you may be get 'socket hang up' error when reuse
|
|
348
|
+
// free socket and timeout happen in the same time.
|
|
349
|
+
if (reqTimeoutListenerCount === 0) {
|
|
350
|
+
const error = new Error('Socket timeout');
|
|
351
|
+
error.code = 'ERR_SOCKET_TIMEOUT';
|
|
352
|
+
error.timeout = timeout;
|
|
353
|
+
// must manually call socket.end() or socket.destroy() to end the connection.
|
|
354
|
+
// https://nodejs.org/dist/latest-v10.x/docs/api/net.html#net_socket_settimeout_timeout_callback
|
|
355
|
+
socket.destroy(error);
|
|
356
|
+
agent.removeSocket(socket, options);
|
|
357
|
+
debug('%s destroy with timeout error', socket[SOCKET_NAME]);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
socket.on('timeout', onTimeout);
|
|
362
|
+
|
|
363
|
+
function onError(err) {
|
|
364
|
+
const listenerCount = socket.listeners('error').length;
|
|
365
|
+
debug('%s(requests: %s, finished: %s) error: %s, listenerCount: %s',
|
|
366
|
+
socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT],
|
|
367
|
+
err, listenerCount);
|
|
368
|
+
agent.errorSocketCount++;
|
|
369
|
+
if (listenerCount === 1) {
|
|
370
|
+
// if socket don't contain error event handler, don't catch it, emit it again
|
|
371
|
+
debug('%s emit uncaught error event', socket[SOCKET_NAME]);
|
|
372
|
+
socket.removeListener('error', onError);
|
|
373
|
+
socket.emit('error', err);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
socket.on('error', onError);
|
|
377
|
+
|
|
378
|
+
function onRemove() {
|
|
379
|
+
debug('%s(requests: %s, finished: %s) agentRemove',
|
|
380
|
+
socket[SOCKET_NAME],
|
|
381
|
+
socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT]);
|
|
382
|
+
// We need this function for cases like HTTP 'upgrade'
|
|
383
|
+
// (defined by WebSockets) where we need to remove a socket from the
|
|
384
|
+
// pool because it'll be locked up indefinitely
|
|
385
|
+
socket.removeListener('close', onClose);
|
|
386
|
+
socket.removeListener('error', onError);
|
|
387
|
+
socket.removeListener('free', onFree);
|
|
388
|
+
socket.removeListener('timeout', onTimeout);
|
|
389
|
+
socket.removeListener('agentRemove', onRemove);
|
|
390
|
+
}
|
|
391
|
+
socket.on('agentRemove', onRemove);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
module.exports = Agent;
|
|
395
|
+
|
|
396
|
+
function inspect(obj) {
|
|
397
|
+
const res = {};
|
|
398
|
+
for (const key in obj) {
|
|
399
|
+
res[key] = obj[key].length;
|
|
400
|
+
}
|
|
401
|
+
return res;
|
|
402
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
// agent
|
|
5
|
+
CURRENT_ID: Symbol('agentkeepalive#currentId'),
|
|
6
|
+
CREATE_ID: Symbol('agentkeepalive#createId'),
|
|
7
|
+
INIT_SOCKET: Symbol('agentkeepalive#initSocket'),
|
|
8
|
+
CREATE_HTTPS_CONNECTION: Symbol('agentkeepalive#createHttpsConnection'),
|
|
9
|
+
// socket
|
|
10
|
+
SOCKET_CREATED_TIME: Symbol('agentkeepalive#socketCreatedTime'),
|
|
11
|
+
SOCKET_NAME: Symbol('agentkeepalive#socketName'),
|
|
12
|
+
SOCKET_REQUEST_COUNT: Symbol('agentkeepalive#socketRequestCount'),
|
|
13
|
+
SOCKET_REQUEST_FINISHED_COUNT: Symbol('agentkeepalive#socketRequestFinishedCount'),
|
|
14
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const OriginalHttpsAgent = require('https').Agent;
|
|
4
|
+
const HttpAgent = require('./agent');
|
|
5
|
+
const {
|
|
6
|
+
INIT_SOCKET,
|
|
7
|
+
CREATE_HTTPS_CONNECTION,
|
|
8
|
+
} = require('./constants');
|
|
9
|
+
|
|
10
|
+
class HttpsAgent extends HttpAgent {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
super(options);
|
|
13
|
+
|
|
14
|
+
this.defaultPort = 443;
|
|
15
|
+
this.protocol = 'https:';
|
|
16
|
+
this.maxCachedSessions = this.options.maxCachedSessions;
|
|
17
|
+
/* istanbul ignore next */
|
|
18
|
+
if (this.maxCachedSessions === undefined) {
|
|
19
|
+
this.maxCachedSessions = 100;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
this._sessionCache = {
|
|
23
|
+
map: {},
|
|
24
|
+
list: [],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
createConnection(options, oncreate) {
|
|
29
|
+
const socket = this[CREATE_HTTPS_CONNECTION](options, oncreate);
|
|
30
|
+
this[INIT_SOCKET](socket, options);
|
|
31
|
+
return socket;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// https://github.com/nodejs/node/blob/master/lib/https.js#L89
|
|
36
|
+
HttpsAgent.prototype[CREATE_HTTPS_CONNECTION] = OriginalHttpsAgent.prototype.createConnection;
|
|
37
|
+
|
|
38
|
+
[
|
|
39
|
+
'getName',
|
|
40
|
+
'_getSession',
|
|
41
|
+
'_cacheSession',
|
|
42
|
+
// https://github.com/nodejs/node/pull/4982
|
|
43
|
+
'_evictSession',
|
|
44
|
+
].forEach(function(method) {
|
|
45
|
+
/* istanbul ignore next */
|
|
46
|
+
if (typeof OriginalHttpsAgent.prototype[method] === 'function') {
|
|
47
|
+
HttpsAgent.prototype[method] = OriginalHttpsAgent.prototype[method];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
module.exports = HttpsAgent;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agentkeepalive",
|
|
3
|
+
"version": "4.5.0",
|
|
4
|
+
"description": "Missing keepalive http.Agent",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"browser": "browser.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.js",
|
|
9
|
+
"index.d.ts",
|
|
10
|
+
"browser.js",
|
|
11
|
+
"lib"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"contributor": "git-contributor",
|
|
15
|
+
"test": "npm run lint && egg-bin test --full-trace",
|
|
16
|
+
"test-local": "egg-bin test --full-trace",
|
|
17
|
+
"cov": "cross-env NODE_DEBUG=agentkeepalive egg-bin cov --full-trace",
|
|
18
|
+
"ci": "npm run lint && npm run cov",
|
|
19
|
+
"lint": "eslint lib test index.js"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git://github.com/node-modules/agentkeepalive.git"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/node-modules/agentkeepalive/issues"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"http",
|
|
30
|
+
"https",
|
|
31
|
+
"agent",
|
|
32
|
+
"keepalive",
|
|
33
|
+
"agentkeepalive",
|
|
34
|
+
"HttpAgent",
|
|
35
|
+
"HttpsAgent"
|
|
36
|
+
],
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"humanize-ms": "^1.2.1"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"coffee": "^5.3.0",
|
|
42
|
+
"cross-env": "^6.0.3",
|
|
43
|
+
"egg-bin": "^4.9.0",
|
|
44
|
+
"eslint": "^5.7.0",
|
|
45
|
+
"eslint-config-egg": "^7.1.0",
|
|
46
|
+
"git-contributor": "^2.0.0",
|
|
47
|
+
"mm": "^2.4.1",
|
|
48
|
+
"pedding": "^1.1.0",
|
|
49
|
+
"typescript": "^3.8.3"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">= 8.0.0"
|
|
53
|
+
},
|
|
54
|
+
"author": "fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2)",
|
|
55
|
+
"license": "MIT"
|
|
56
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Alex Indigo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|