@yanglaofish/fishtools 0.5.1 → 0.5.3
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 +25 -11
- package/manual/README.md +25 -11
- package/manual/docs/deployment.md +3 -3
- package/manual/docs/examples/action-plugin/package.json +1 -1
- package/manual/docs/modules.md +2 -0
- package/manual/docs/plugin-development.md +18 -5
- package/manual/docs/releases.md +56 -6
- package/manual/docs/superpowers/plans/2026-10-13-command-shortcuts.md +108 -0
- package/manual/docs/superpowers/plans/2026-10-13-global-plugins.md +56 -0
- package/manual/docs/superpowers/plans/2026-10-13-tui-readable-sessions.md +21 -0
- package/manual/docs/superpowers/reviews/2026-10-13-0.5.0-followup-review.md +4 -1
- package/manual/docs/superpowers/reviews/2026-10-13-0.5.3-review.md +28 -0
- package/manual/docs/superpowers/reviews/2026-10-13-command-shortcuts-review.md +70 -0
- package/manual/docs/superpowers/reviews/2026-10-13-tui-sessions-review.md +55 -0
- package/manual/docs/superpowers/specs/2026-10-12-workflow-variation-design.md +1 -1
- package/manual/docs/superpowers/specs/2026-10-13-command-shortcuts-design.md +56 -0
- package/manual/docs/superpowers/specs/2026-10-13-issue-4-workflow-menu.md +51 -0
- package/manual/docs/superpowers/specs/2026-10-13-issue-5-results-and-history.md +20 -0
- package/manual/docs/terminal-commands.md +72 -0
- package/manual/docs/verification.md +56 -1
- package/manual/packages/core/README.md +5 -1
- package/manual/packages/core/package.json +2 -1
- package/manual/packages/core/src/application.js +203 -57
- package/manual/packages/core/src/development-watch-worker.js +10 -1
- package/manual/packages/core/src/development.js +1 -1
- package/manual/packages/core/src/export-snapshot.js +20 -1
- package/manual/packages/core/src/plugin-catalog.js +42 -0
- package/manual/packages/core/src/version.js +1 -1
- package/manual/packages/fst-cli/README.md +6 -0
- package/manual/packages/fst-cli/bin/fst.js +7 -6
- package/manual/packages/fst-cli/package.json +1 -1
- package/manual/packages/fst-cli/src/development.js +6 -1
- package/manual/packages/fst-cli/src/terminal/command-menu.js +191 -0
- package/manual/packages/fst-cli/src/terminal/navigation.js +6 -3
- package/manual/packages/fst-cli/src/terminal/presentation.js +4 -3
- package/manual/packages/fst-cli/src/terminal/run-feed.js +69 -13
- package/manual/packages/fst-cli/src/terminal/run-presentation.js +55 -12
- package/manual/packages/fst-cli/src/terminal/run-viewer.js +26 -10
- package/manual/packages/fst-cli/src/terminal/session-history.js +82 -0
- package/manual/packages/fst-cli/src/terminal/session.js +153 -43
- package/manual/packages/fst-cli/src/terminal/view.js +74 -16
- package/manual/packages/fst-cli/src/terminal/workflow-menu.js +15 -15
- package/manual/packages/fst-devtools/package.json +2 -2
- package/manual/packages/fst-devtools/src/documentation.js +2 -1
- package/manual/packages/fst-devtools/src/plugin-tools.js +1 -1
- package/manual/packages/fst-logs/README.md +23 -2
- package/manual/packages/fst-logs/package.json +2 -1
- package/manual/packages/fst-logs/src/file-identity.js +23 -0
- package/manual/packages/fst-logs/src/markdown-log.js +4 -3
- package/manual/packages/fst-logs/src/run-logs.js +3 -2
- package/manual/packages/fst-logs/src/session-history.js +180 -0
- package/manual/packages/fst-platform/README.md +15 -0
- package/manual/packages/fst-platform/package.json +4 -3
- package/manual/packages/fst-platform/src/process.js +15 -8
- package/manual/packages/fst-platform/src/shell.js +103 -0
- package/manual/packages/fst-plugin/package.json +1 -1
- package/manual/packages/fst-plugin/src/contracts.js +6 -2
- package/manual/packages/fst-plugin/src/host.js +31 -23
- package/manual/packages/fst-workflow/package.json +1 -1
- package/manual/packages/fst-workflow/src/engine.js +1 -1
- package/manual/packages/fst-workspace/README.md +5 -0
- package/manual/packages/fst-workspace/package.json +3 -1
- package/manual/packages/fst-workspace/src/plugin-registry.js +58 -0
- package/manual/packages/fst-workspace/src/plugins.js +7 -4
- package/manual/packages/fst-workspace/src/shortcuts.js +119 -0
- package/manual/packages/fst-workspace/src/workflows.js +5 -3
- package/manual/packages/pack/index.js +1 -1
- package/manual/packages/pack/package.json +3 -3
- package/manual/packages/pack/runtime-cache.js +26 -0
- package/manual/packages/pack/runtime.js +6 -10
- package/manual/plugins/commands/LICENSE +21 -0
- package/manual/plugins/commands/README.md +41 -0
- package/manual/plugins/commands/index.js +94 -0
- package/manual/plugins/commands/package.json +17 -0
- package/node_modules/@mytools/commands/LICENSE +21 -0
- package/node_modules/@mytools/commands/README.md +41 -0
- package/node_modules/@mytools/commands/index.js +94 -0
- package/node_modules/@mytools/commands/package.json +17 -0
- package/node_modules/@mytools/core/README.md +5 -1
- package/node_modules/@mytools/core/package.json +2 -1
- package/node_modules/@mytools/core/src/application.js +203 -57
- package/node_modules/@mytools/core/src/development-watch-worker.js +10 -1
- package/node_modules/@mytools/core/src/development.js +1 -1
- package/node_modules/@mytools/core/src/export-snapshot.js +20 -1
- package/node_modules/@mytools/core/src/plugin-catalog.js +42 -0
- package/node_modules/@mytools/core/src/version.js +1 -1
- package/node_modules/@mytools/fst-cli/README.md +6 -0
- package/node_modules/@mytools/fst-cli/bin/fst.js +7 -6
- package/node_modules/@mytools/fst-cli/package.json +1 -1
- package/node_modules/@mytools/fst-cli/src/development.js +6 -1
- package/node_modules/@mytools/fst-cli/src/terminal/command-menu.js +191 -0
- package/node_modules/@mytools/fst-cli/src/terminal/navigation.js +6 -3
- package/node_modules/@mytools/fst-cli/src/terminal/presentation.js +4 -3
- package/node_modules/@mytools/fst-cli/src/terminal/run-feed.js +69 -13
- package/node_modules/@mytools/fst-cli/src/terminal/run-presentation.js +55 -12
- package/node_modules/@mytools/fst-cli/src/terminal/run-viewer.js +26 -10
- package/node_modules/@mytools/fst-cli/src/terminal/session-history.js +82 -0
- package/node_modules/@mytools/fst-cli/src/terminal/session.js +153 -43
- package/node_modules/@mytools/fst-cli/src/terminal/view.js +74 -16
- package/node_modules/@mytools/fst-cli/src/terminal/workflow-menu.js +15 -15
- package/node_modules/@mytools/fst-devtools/package.json +2 -2
- package/node_modules/@mytools/fst-devtools/src/documentation.js +2 -1
- package/node_modules/@mytools/fst-devtools/src/plugin-tools.js +1 -1
- package/node_modules/@mytools/fst-logs/README.md +23 -2
- package/node_modules/@mytools/fst-logs/package.json +2 -1
- package/node_modules/@mytools/fst-logs/src/file-identity.js +23 -0
- package/node_modules/@mytools/fst-logs/src/markdown-log.js +4 -3
- package/node_modules/@mytools/fst-logs/src/run-logs.js +3 -2
- package/node_modules/@mytools/fst-logs/src/session-history.js +180 -0
- package/node_modules/@mytools/fst-platform/README.md +15 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/LICENSE +21 -0
- package/node_modules/{undici/docs/docs/index.md → @mytools/fst-platform/node_modules/undici/README.md} +85 -137
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Agent.md +84 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/CacheStore.md +164 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Client.md +288 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/ClientStats.md +27 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Connector.md +115 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/ContentType.md +57 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Cookies.md +128 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Debug.md +62 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +317 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Dispatcher.md +1393 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +159 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Errors.md +49 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/EventSource.md +45 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Fetch.md +60 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/GlobalInstallation.md +139 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/H2CClient.md +263 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockAgent.md +603 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockCallHistory.md +197 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +43 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockClient.md +81 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockPool.md +555 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Pool.md +84 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/ProxyAgent.md +229 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RedirectHandler.md +93 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RetryAgent.md +50 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RetryHandler.md +118 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RoundRobinPool.md +145 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/SnapshotAgent.md +616 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +275 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Util.md +25 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/WebSocket.md +141 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/docs/docs/best-practices/crawling.md +1 -3
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/mocking-request.md +190 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/docs/docs/best-practices/undici-vs-builtin-fetch.md +8 -10
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/writing-tests.md +63 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/index-fetch.js +65 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/index.d.ts +3 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/index.js +234 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/abort-signal.js +59 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-connect.js +110 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-pipeline.js +252 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-request.js +214 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-stream.js +209 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-upgrade.js +111 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/index.js +7 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/readable.js +580 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/cache/memory-cache-store.js +3 -3
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/cache/sqlite-cache-store.js +1 -3
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/connect.js +153 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/constants.js +143 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/diagnostics.js +227 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/errors.js +477 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/request.js +485 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/symbols.js +75 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/tree.js +160 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/util.js +992 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/agent.js +158 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/balanced-pool.js +221 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/client-h1.js +1746 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/client-h2.js +1060 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/client.js +668 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/dispatcher-base.js +184 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/dispatcher.js +48 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/dispatcher/h2c-client.js +4 -4
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/pool-base.js +214 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/pool.js +118 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/proxy-agent.js +319 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/dispatcher/round-robin-pool.js +10 -32
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/dispatcher/socks5-proxy-agent.js +63 -153
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/global.js +59 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/handler/cache-handler.js +7 -49
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/handler/cache-revalidation-handler.js +0 -10
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/decorator-handler.js +67 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/handler/deduplication-handler.js +10 -29
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/redirect-handler.js +238 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/retry-handler.js +504 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/unwrap-handler.js +106 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/wrap-handler.js +105 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/interceptor/cache.js +26 -79
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/interceptor/decompress.js +3 -13
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/interceptor/deduplicate.js +4 -5
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/dns.js +571 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/dump.js +99 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/redirect.js +21 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/response-error.js +95 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/retry.js +19 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/constants.js +531 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/utils.js +12 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-agent.js +232 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/mock-call-history.js +1 -1
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-client.js +68 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-errors.js +29 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-pool.js +68 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-symbols.js +32 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-utils.js +486 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/snapshot-agent.js +7 -25
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/snapshot-recorder.js +3 -38
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/cache.js +10 -92
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/util/promise.js +28 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/runtime-features.js +34 -3
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/util/timers.js +425 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cache/cache.js +864 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cache/util.js +45 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/constants.js +12 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/index.js +199 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/parse.js +314 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/util.js +352 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/eventsource/eventsource-stream.js +494 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/eventsource/eventsource.js +501 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/eventsource/util.js +29 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/LICENSE +21 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/body.js +509 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/constants.js +131 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/data-url.js +596 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/formdata-parser.js +586 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/formdata.js +259 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/global.js +40 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/headers.js +719 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/index.js +2413 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/request.js +1115 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/response.js +641 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/util.js +1522 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/infra/index.js +1 -16
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/webidl/index.js +21 -7
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/connection.js +339 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/constants.js +126 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/events.js +331 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/frame.js +133 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/permessage-deflate.js +105 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/receiver.js +507 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/sender.js +109 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/websocket/stream/websocketerror.js +10 -13
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/websocket/stream/websocketstream.js +14 -29
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/util.js +347 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/websocket.js +758 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/package.json +152 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/scripts/strip-comments.js +10 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/README.md +6 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/agent.d.ts +32 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/api.d.ts +43 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/balanced-pool.d.ts +30 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/cache.d.ts +36 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/client.d.ts +139 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/connector.d.ts +36 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/content-type.d.ts +21 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/cookies.d.ts +30 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/diagnostics-channel.d.ts +74 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/dispatcher.d.ts +275 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/env-http-proxy-agent.d.ts +22 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/errors.d.ts +177 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/eventsource.d.ts +66 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/fetch.d.ts +231 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/formdata.d.ts +114 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/global-dispatcher.d.ts +9 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/global-origin.d.ts +7 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/h2c-client.d.ts +6 -6
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/handlers.d.ts +14 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/header.d.ts +160 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/index.d.ts +91 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/interceptors.d.ts +82 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-agent.d.ts +68 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-client.d.ts +27 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-errors.d.ts +12 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-interceptor.d.ts +94 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-pool.d.ts +27 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/patch.d.ts +29 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/pool-stats.d.ts +19 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/pool.d.ts +41 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/proxy-agent.d.ts +29 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/readable.d.ts +68 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/retry-agent.d.ts +8 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/retry-handler.d.ts +125 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/round-robin-pool.d.ts +2 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/snapshot-agent.d.ts +0 -4
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/socks5-proxy-agent.d.ts +2 -4
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/util.d.ts +18 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/webidl.d.ts +347 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/websocket.d.ts +188 -0
- package/node_modules/@mytools/fst-platform/package.json +4 -3
- package/node_modules/@mytools/fst-platform/src/process.js +15 -8
- package/node_modules/@mytools/fst-platform/src/shell.js +103 -0
- package/node_modules/@mytools/fst-plugin/package.json +1 -1
- package/node_modules/@mytools/fst-plugin/src/contracts.js +6 -2
- package/node_modules/@mytools/fst-plugin/src/host.js +31 -23
- package/node_modules/@mytools/fst-workflow/package.json +1 -1
- package/node_modules/@mytools/fst-workflow/src/engine.js +1 -1
- package/node_modules/@mytools/fst-workspace/README.md +5 -0
- package/node_modules/@mytools/fst-workspace/package.json +3 -1
- package/node_modules/@mytools/fst-workspace/src/plugin-registry.js +58 -0
- package/node_modules/@mytools/fst-workspace/src/plugins.js +7 -4
- package/node_modules/@mytools/fst-workspace/src/shortcuts.js +119 -0
- package/node_modules/@mytools/fst-workspace/src/workflows.js +5 -3
- package/node_modules/@mytools/pack/index.js +1 -1
- package/node_modules/@mytools/pack/package.json +3 -3
- package/node_modules/@mytools/pack/runtime-cache.js +26 -0
- package/node_modules/@mytools/pack/runtime.js +6 -10
- package/node_modules/@mytools/web/public/THIRD_PARTY_NOTICES.txt +1246 -1232
- package/node_modules/@npmcli/agent/lib/agents.js +0 -10
- package/node_modules/@npmcli/agent/package.json +12 -11
- package/node_modules/@npmcli/arborist/README.md +2 -2
- package/node_modules/@npmcli/arborist/bin/index.js +2 -1
- package/node_modules/@npmcli/arborist/bin/shrinkwrap.js +7 -0
- package/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js +25 -159
- package/node_modules/@npmcli/arborist/lib/arborist/isolated-reifier.js +49 -11
- package/node_modules/@npmcli/arborist/lib/arborist/load-actual.js +0 -67
- package/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js +37 -5
- package/node_modules/@npmcli/arborist/lib/arborist/rebuild.js +8 -15
- package/node_modules/@npmcli/arborist/lib/arborist/reify.js +42 -59
- package/node_modules/@npmcli/arborist/lib/consistent-resolve.js +1 -1
- package/node_modules/@npmcli/arborist/lib/diff.js +22 -17
- package/node_modules/@npmcli/arborist/lib/edge.js +2 -22
- package/node_modules/@npmcli/arborist/lib/index.js +0 -2
- package/node_modules/@npmcli/arborist/lib/isolated-classes.js +1 -4
- package/node_modules/@npmcli/arborist/lib/node.js +9 -13
- package/node_modules/@npmcli/arborist/lib/place-dep.js +0 -6
- package/node_modules/@npmcli/arborist/lib/printable.js +5 -0
- package/node_modules/@npmcli/arborist/lib/shrinkwrap.js +32 -55
- package/node_modules/@npmcli/arborist/package.json +26 -32
- package/node_modules/@npmcli/fs/lib/move-file.js +5 -5
- package/node_modules/@npmcli/fs/package.json +5 -5
- package/node_modules/@npmcli/git/package.json +12 -13
- package/node_modules/@npmcli/installed-package-contents/package.json +7 -7
- package/node_modules/@npmcli/map-workspaces/package.json +7 -7
- package/node_modules/@npmcli/metavuln-calculator/package.json +16 -10
- package/node_modules/@npmcli/name-from-folder/package.json +16 -13
- package/node_modules/@npmcli/node-gyp/package.json +5 -5
- package/node_modules/@npmcli/package-json/lib/index.js +1 -2
- package/node_modules/@npmcli/package-json/lib/normalize.js +22 -23
- package/node_modules/@npmcli/package-json/package.json +10 -11
- package/node_modules/@npmcli/promise-spawn/README.md +2 -1
- package/node_modules/@npmcli/promise-spawn/package.json +5 -5
- package/node_modules/@npmcli/redact/package.json +4 -4
- package/node_modules/@npmcli/run-script/lib/is-server-package.js +11 -0
- package/node_modules/@npmcli/run-script/lib/make-spawn-args.js +6 -5
- package/node_modules/@npmcli/run-script/lib/run-script-pkg.js +13 -4
- package/node_modules/@npmcli/run-script/lib/run-script.js +2 -1
- package/node_modules/@npmcli/run-script/package.json +11 -12
- package/node_modules/@sigstore/bundle/README.md +1 -1
- package/node_modules/@sigstore/bundle/dist/error.js +0 -1
- package/node_modules/@sigstore/bundle/package.json +2 -2
- package/node_modules/@sigstore/core/README.md +1 -1
- package/node_modules/@sigstore/core/dist/asn1/length.js +1 -12
- package/node_modules/@sigstore/core/dist/asn1/obj.js +7 -25
- package/node_modules/@sigstore/core/dist/asn1/parse.js +5 -24
- package/node_modules/@sigstore/core/package.json +2 -2
- package/node_modules/@sigstore/sign/README.md +1 -1
- package/node_modules/@sigstore/sign/dist/signer/fulcio/ephemeral.js +1 -1
- package/node_modules/@sigstore/sign/package.json +9 -9
- package/node_modules/@sigstore/tuf/README.md +1 -1
- package/node_modules/@sigstore/tuf/package.json +4 -4
- package/node_modules/@sigstore/tuf/seeds.json +1 -1
- package/node_modules/@sigstore/verify/README.md +1 -1
- package/node_modules/@sigstore/verify/dist/bundle/dsse.d.ts +0 -1
- package/node_modules/@sigstore/verify/dist/bundle/dsse.js +0 -6
- package/node_modules/@sigstore/verify/dist/bundle/message.d.ts +0 -1
- package/node_modules/@sigstore/verify/dist/bundle/message.js +0 -5
- package/node_modules/@sigstore/verify/dist/policy.d.ts +1 -1
- package/node_modules/@sigstore/verify/dist/policy.js +2 -0
- package/node_modules/@sigstore/verify/dist/shared.types.d.ts +1 -6
- package/node_modules/@sigstore/verify/dist/tlog/checkpoint.js +3 -17
- package/node_modules/@sigstore/verify/dist/tlog/hashedrekord.js +4 -4
- package/node_modules/@sigstore/verify/dist/tlog/index.js +1 -13
- package/node_modules/@sigstore/verify/dist/tlog/merkle.js +1 -12
- package/node_modules/@sigstore/verify/dist/verifier.js +5 -13
- package/node_modules/@sigstore/verify/package.json +5 -5
- package/node_modules/@tufjs/models/package.json +3 -3
- package/node_modules/abbrev/package.json +8 -9
- package/node_modules/agent-base/dist/helpers.d.ts +5 -0
- package/node_modules/agent-base/dist/helpers.d.ts.map +1 -1
- package/node_modules/agent-base/dist/helpers.js +34 -5
- package/node_modules/agent-base/dist/helpers.js.map +1 -1
- package/node_modules/agent-base/dist/index.d.ts +5 -1
- package/node_modules/agent-base/dist/index.d.ts.map +1 -1
- package/node_modules/agent-base/dist/index.js +40 -8
- package/node_modules/agent-base/dist/index.js.map +1 -1
- package/node_modules/agent-base/package.json +12 -12
- package/node_modules/bin-links/README.md +4 -5
- package/node_modules/bin-links/lib/fix-bin.js +1 -3
- package/node_modules/bin-links/lib/index.js +16 -8
- package/node_modules/bin-links/lib/link-mans.js +53 -0
- package/node_modules/bin-links/package.json +12 -11
- package/node_modules/cacache/lib/content/write.js +0 -2
- package/node_modules/cacache/lib/entry-index.js +0 -3
- package/node_modules/cacache/lib/rm.js +0 -1
- package/node_modules/cacache/lib/util/tmp.js +1 -5
- package/node_modules/cacache/lib/verify.js +2 -2
- package/node_modules/cacache/package.json +7 -7
- package/node_modules/cmd-shim/lib/index.js +32 -67
- package/node_modules/cmd-shim/package.json +5 -5
- package/node_modules/hosted-git-info/README.md +1 -1
- package/node_modules/hosted-git-info/lib/parse-url.js +3 -1
- package/node_modules/hosted-git-info/package.json +4 -4
- package/node_modules/http-proxy-agent/dist/index.d.ts +5 -8
- package/node_modules/http-proxy-agent/dist/index.d.ts.map +1 -1
- package/node_modules/http-proxy-agent/dist/index.js +42 -26
- package/node_modules/http-proxy-agent/dist/index.js.map +1 -1
- package/node_modules/http-proxy-agent/package.json +14 -15
- package/node_modules/https-proxy-agent/dist/index.d.ts +5 -9
- package/node_modules/https-proxy-agent/dist/index.d.ts.map +1 -1
- package/node_modules/https-proxy-agent/dist/index.js +44 -98
- package/node_modules/https-proxy-agent/dist/index.js.map +1 -1
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +3 -0
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +1 -1
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +10 -3
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -1
- package/node_modules/https-proxy-agent/package.json +15 -16
- package/node_modules/ignore-walk/package.json +4 -4
- package/node_modules/ini/package.json +5 -5
- package/node_modules/ip-address/README.md +70 -70
- package/node_modules/ip-address/dist/ipv6.js +7 -4
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts +3 -0
- package/node_modules/ip-address/dist/v6/constants.js +3 -0
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/ip-address/package.json +2 -1
- package/node_modules/json-parse-even-better-errors/lib/index.js +1 -3
- package/node_modules/json-parse-even-better-errors/package.json +17 -13
- package/node_modules/make-fetch-happen/package.json +11 -11
- package/node_modules/minipass-fetch/package.json +4 -4
- package/node_modules/node-gyp/.release-please-manifest.json +1 -1
- package/node_modules/node-gyp/CHANGELOG.md +0 -102
- package/node_modules/node-gyp/README.md +2 -3
- package/node_modules/node-gyp/eslint.config.js +1 -4
- package/node_modules/node-gyp/gyp/.release-please-manifest.json +1 -1
- package/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +19 -14
- package/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +2 -7
- package/node_modules/node-gyp/gyp/pyproject.toml +1 -1
- package/node_modules/node-gyp/lib/build.js +6 -18
- package/node_modules/node-gyp/lib/create-config-gypi.js +0 -5
- package/node_modules/node-gyp/lib/node-gyp.js +2 -9
- package/node_modules/node-gyp/lib/rebuild.js +3 -3
- package/node_modules/node-gyp/package.json +9 -11
- package/node_modules/nopt/README.md +4 -2
- package/node_modules/nopt/lib/debug.js +5 -0
- package/node_modules/nopt/lib/nopt-lib.js +43 -7
- package/node_modules/nopt/lib/nopt.js +4 -2
- package/node_modules/nopt/lib/type-defs.js +13 -8
- package/node_modules/nopt/package.json +17 -15
- package/node_modules/npm-bundled/package.json +6 -6
- package/node_modules/npm-install-checks/package.json +5 -5
- package/node_modules/npm-normalize-package-bin/package.json +16 -13
- package/node_modules/npm-package-arg/package.json +7 -7
- package/node_modules/npm-packlist/README.md +30 -45
- package/node_modules/npm-packlist/lib/index.js +47 -115
- package/node_modules/npm-packlist/package.json +8 -10
- package/node_modules/npm-pick-manifest/package.json +19 -15
- package/node_modules/npm-registry-fetch/lib/errors.js +3 -8
- package/node_modules/npm-registry-fetch/package.json +12 -12
- package/node_modules/pacote/lib/dir.js +5 -60
- package/node_modules/pacote/lib/fetcher.js +0 -4
- package/node_modules/pacote/lib/git.js +3 -11
- package/node_modules/pacote/lib/util/add-git-sha.js +1 -1
- package/node_modules/pacote/package.json +18 -19
- package/node_modules/parse-conflict-json/package.json +6 -6
- package/node_modules/proc-log/package.json +4 -4
- package/node_modules/read-cmd-shim/lib/index.js +1 -1
- package/node_modules/read-cmd-shim/package.json +18 -14
- package/node_modules/sigstore/README.md +1 -1
- package/node_modules/sigstore/package.json +10 -10
- package/node_modules/socks-proxy-agent/dist/index.d.ts +3 -1
- package/node_modules/socks-proxy-agent/dist/index.d.ts.map +1 -1
- package/node_modules/socks-proxy-agent/dist/index.js +43 -17
- package/node_modules/socks-proxy-agent/dist/index.js.map +1 -1
- package/node_modules/socks-proxy-agent/package.json +15 -15
- package/node_modules/ssri/package.json +4 -4
- package/node_modules/tuf-js/dist/config.d.ts +2 -2
- package/node_modules/tuf-js/dist/fetcher.d.ts +4 -4
- package/node_modules/tuf-js/dist/fetcher.js +16 -55
- package/node_modules/tuf-js/dist/updater.js +2 -2
- package/node_modules/tuf-js/package.json +8 -8
- package/node_modules/undici/README.md +72 -405
- package/node_modules/undici/docs/docs/api/Agent.md +41 -252
- package/node_modules/undici/docs/docs/api/BalancedPool.md +48 -246
- package/node_modules/undici/docs/docs/api/CacheStorage.md +13 -171
- package/node_modules/undici/docs/docs/api/Client.md +139 -395
- package/node_modules/undici/docs/docs/api/Connector.md +35 -118
- package/node_modules/undici/docs/docs/api/ContentType.md +25 -65
- package/node_modules/undici/docs/docs/api/Cookies.md +47 -125
- package/node_modules/undici/docs/docs/api/Debug.md +31 -47
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +97 -409
- package/node_modules/undici/docs/docs/api/DispatchInterceptor.md +60 -0
- package/node_modules/undici/docs/docs/api/Dispatcher.md +1011 -500
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +96 -105
- package/node_modules/undici/docs/docs/api/Errors.md +28 -528
- package/node_modules/undici/docs/docs/api/EventSource.md +13 -326
- package/node_modules/undici/docs/docs/api/Fetch.md +24 -693
- package/node_modules/undici/docs/docs/api/MockAgent.md +264 -346
- package/node_modules/undici/docs/docs/api/MockClient.md +31 -153
- package/node_modules/undici/docs/docs/api/MockErrors.md +5 -56
- package/node_modules/undici/docs/docs/api/MockPool.md +253 -324
- package/node_modules/undici/docs/docs/api/Pool.md +41 -235
- package/node_modules/undici/docs/docs/api/PoolStats.md +13 -119
- package/node_modules/undici/docs/docs/api/ProxyAgent.md +81 -198
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +58 -238
- package/node_modules/undici/docs/docs/api/RetryAgent.md +28 -119
- package/node_modules/undici/docs/docs/api/RetryHandler.md +78 -161
- package/node_modules/undici/docs/docs/api/Util.md +11 -68
- package/node_modules/undici/docs/docs/api/WebSocket.md +24 -509
- package/node_modules/undici/docs/docs/api/api-lifecycle.md +33 -101
- package/node_modules/undici/docs/docs/best-practices/client-certificate.md +0 -2
- package/node_modules/undici/docs/docs/best-practices/mocking-request.md +2 -58
- package/node_modules/undici/docs/docs/best-practices/proxy.md +1 -3
- package/node_modules/undici/docs/docs/best-practices/writing-tests.md +0 -45
- package/node_modules/undici/index-fetch.js +4 -34
- package/node_modules/undici/index.d.ts +1 -1
- package/node_modules/undici/index.js +20 -87
- package/node_modules/undici/lib/api/abort-signal.js +0 -2
- package/node_modules/undici/lib/api/api-connect.js +11 -15
- package/node_modules/undici/lib/api/api-pipeline.js +19 -33
- package/node_modules/undici/lib/api/api-request.js +59 -89
- package/node_modules/undici/lib/api/api-stream.js +64 -114
- package/node_modules/undici/lib/api/api-upgrade.js +13 -26
- package/node_modules/undici/lib/api/readable.js +87 -317
- package/node_modules/undici/lib/api/util.js +93 -0
- package/node_modules/undici/lib/core/connect.js +125 -77
- package/node_modules/undici/lib/core/constants.js +9 -11
- package/node_modules/undici/lib/core/diagnostics.js +129 -154
- package/node_modules/undici/lib/core/errors.js +50 -122
- package/node_modules/undici/lib/core/request.js +87 -172
- package/node_modules/undici/lib/core/symbols.js +2 -14
- package/node_modules/undici/lib/core/tree.js +2 -10
- package/node_modules/undici/lib/core/util.js +190 -481
- package/node_modules/undici/lib/dispatcher/agent.js +35 -83
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +38 -46
- package/node_modules/undici/lib/dispatcher/client-h1.js +199 -492
- package/node_modules/undici/lib/dispatcher/client-h2.js +380 -1409
- package/node_modules/undici/lib/dispatcher/client.js +130 -253
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +52 -50
- package/node_modules/undici/lib/dispatcher/dispatcher.js +24 -17
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +45 -75
- package/node_modules/undici/lib/dispatcher/fixed-queue.js +50 -68
- package/node_modules/undici/lib/dispatcher/pool-base.js +54 -153
- package/node_modules/undici/lib/dispatcher/pool-stats.js +34 -0
- package/node_modules/undici/lib/dispatcher/pool.js +16 -135
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +41 -175
- package/node_modules/undici/lib/dispatcher/retry-agent.js +0 -3
- package/node_modules/undici/lib/global.js +9 -59
- package/node_modules/undici/lib/handler/decorator-handler.js +15 -43
- package/node_modules/undici/lib/handler/redirect-handler.js +116 -127
- package/node_modules/undici/lib/handler/retry-handler.js +182 -398
- package/node_modules/undici/lib/interceptor/dns.js +47 -254
- package/node_modules/undici/lib/interceptor/dump.js +56 -32
- package/node_modules/undici/lib/interceptor/redirect-interceptor.js +21 -0
- package/node_modules/undici/lib/interceptor/redirect.js +14 -11
- package/node_modules/undici/lib/interceptor/response-error.js +22 -31
- package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/node_modules/undici/lib/llhttp/constants.js +193 -446
- package/node_modules/undici/lib/llhttp/llhttp-wasm.js +1 -11
- package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +1 -11
- package/node_modules/undici/lib/llhttp/utils.js +12 -9
- package/node_modules/undici/lib/mock/mock-agent.js +22 -106
- package/node_modules/undici/lib/mock/mock-client.js +4 -13
- package/node_modules/undici/lib/mock/mock-errors.js +2 -3
- package/node_modules/undici/lib/mock/mock-interceptor.js +13 -33
- package/node_modules/undici/lib/mock/mock-pool.js +4 -13
- package/node_modules/undici/lib/mock/mock-symbols.js +1 -10
- package/node_modules/undici/lib/mock/mock-utils.js +51 -404
- package/node_modules/undici/lib/mock/pluralizer.js +29 -0
- package/node_modules/undici/lib/util/timers.js +9 -11
- package/node_modules/undici/lib/web/cache/cache.js +51 -63
- package/node_modules/undici/lib/web/cache/cachestorage.js +7 -13
- package/node_modules/undici/lib/web/cache/symbols.js +5 -0
- package/node_modules/undici/lib/web/cookies/index.js +18 -45
- package/node_modules/undici/lib/web/cookies/parse.js +149 -157
- package/node_modules/undici/lib/web/cookies/util.js +2 -4
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +9 -37
- package/node_modules/undici/lib/web/eventsource/eventsource.js +64 -108
- package/node_modules/undici/lib/web/eventsource/util.js +5 -28
- package/node_modules/undici/lib/web/fetch/body.js +148 -173
- package/node_modules/undici/lib/web/fetch/constants.js +6 -13
- package/node_modules/undici/lib/web/fetch/data-url.js +167 -19
- package/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +46 -0
- package/node_modules/undici/lib/web/fetch/file.js +126 -0
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +117 -229
- package/node_modules/undici/lib/web/fetch/formdata.js +65 -85
- package/node_modules/undici/lib/web/fetch/headers.js +108 -143
- package/node_modules/undici/lib/web/fetch/index.js +446 -627
- package/node_modules/undici/lib/web/fetch/request.js +115 -217
- package/node_modules/undici/lib/web/fetch/response.js +82 -110
- package/node_modules/undici/lib/web/fetch/symbols.js +9 -0
- package/node_modules/undici/lib/web/fetch/util.js +393 -291
- package/node_modules/undici/lib/web/fetch/webidl.js +695 -0
- package/node_modules/undici/lib/web/fileapi/encoding.js +290 -0
- package/node_modules/undici/lib/web/fileapi/filereader.js +344 -0
- package/node_modules/undici/lib/web/fileapi/progressevent.js +78 -0
- package/node_modules/undici/lib/web/fileapi/symbols.js +10 -0
- package/node_modules/undici/lib/web/fileapi/util.js +391 -0
- package/node_modules/undici/lib/web/websocket/connection.js +160 -139
- package/node_modules/undici/lib/web/websocket/constants.js +10 -70
- package/node_modules/undici/lib/web/websocket/events.js +30 -49
- package/node_modules/undici/lib/web/websocket/frame.js +20 -51
- package/node_modules/undici/lib/web/websocket/receiver.js +87 -83
- package/node_modules/undici/lib/web/websocket/sender.js +13 -18
- package/node_modules/undici/lib/web/websocket/symbols.js +12 -0
- package/node_modules/undici/lib/web/websocket/util.js +90 -115
- package/node_modules/undici/lib/web/websocket/websocket.js +171 -359
- package/node_modules/undici/package.json +57 -49
- package/node_modules/undici/scripts/strip-comments.js +1 -3
- package/node_modules/undici/types/agent.d.ts +13 -12
- package/node_modules/undici/types/api.d.ts +26 -26
- package/node_modules/undici/types/balanced-pool.d.ts +12 -13
- package/node_modules/undici/types/client.d.ts +39 -98
- package/node_modules/undici/types/connector.d.ts +2 -5
- package/node_modules/undici/types/cookies.d.ts +1 -3
- package/node_modules/undici/types/diagnostics-channel.d.ts +11 -20
- package/node_modules/undici/types/dispatcher.d.ts +139 -136
- package/node_modules/undici/types/env-http-proxy-agent.d.ts +3 -4
- package/node_modules/undici/types/errors.d.ts +54 -86
- package/node_modules/undici/types/eventsource.d.ts +4 -9
- package/node_modules/undici/types/fetch.d.ts +25 -51
- package/node_modules/undici/types/file.d.ts +39 -0
- package/node_modules/undici/types/filereader.d.ts +54 -0
- package/node_modules/undici/types/formdata.d.ts +7 -7
- package/node_modules/undici/types/global-dispatcher.d.ts +4 -4
- package/node_modules/undici/types/global-origin.d.ts +5 -5
- package/node_modules/undici/types/handlers.d.ts +9 -10
- package/node_modules/undici/types/header.d.ts +1 -162
- package/node_modules/undici/types/index.d.ts +47 -69
- package/node_modules/undici/types/interceptors.d.ts +12 -62
- package/node_modules/undici/types/mock-agent.d.ts +27 -46
- package/node_modules/undici/types/mock-client.d.ts +4 -6
- package/node_modules/undici/types/mock-errors.d.ts +3 -3
- package/node_modules/undici/types/mock-interceptor.d.ts +21 -26
- package/node_modules/undici/types/mock-pool.d.ts +4 -6
- package/node_modules/undici/types/patch.d.ts +4 -0
- package/node_modules/undici/types/pool-stats.d.ts +8 -8
- package/node_modules/undici/types/pool.d.ts +14 -14
- package/node_modules/undici/types/proxy-agent.d.ts +6 -13
- package/node_modules/undici/types/readable.d.ts +16 -19
- package/node_modules/undici/types/retry-agent.d.ts +1 -1
- package/node_modules/undici/types/retry-handler.d.ts +9 -18
- package/node_modules/undici/types/util.d.ts +3 -3
- package/node_modules/undici/types/webidl.d.ts +32 -156
- package/node_modules/undici/types/websocket.d.ts +10 -48
- package/node_modules/validate-npm-package-name/package.json +4 -4
- package/node_modules/which/package.json +4 -4
- package/node_modules/write-file-atomic/package.json +4 -4
- package/package.json +58 -60
- package/node_modules/@npmcli/arborist/lib/npm-extension.js +0 -237
- package/node_modules/@npmcli/arborist/lib/package-extensions.js +0 -236
- package/node_modules/@npmcli/arborist/lib/patch.js +0 -111
- package/node_modules/@npmcli/arborist/lib/patched-dependencies.js +0 -168
- package/node_modules/cacache/lib/util/cache-dir.js +0 -29
- package/node_modules/diff/CONTRIBUTING.md +0 -28
- package/node_modules/diff/LICENSE +0 -29
- package/node_modules/diff/README.md +0 -388
- package/node_modules/diff/dist/diff.js +0 -1782
- package/node_modules/diff/dist/diff.min.js +0 -1
- package/node_modules/diff/eslint.config.mjs +0 -182
- package/node_modules/diff/libcjs/convert/dmp.d.ts +0 -8
- package/node_modules/diff/libcjs/convert/dmp.d.ts.map +0 -1
- package/node_modules/diff/libcjs/convert/dmp.js +0 -24
- package/node_modules/diff/libcjs/convert/xml.d.ts +0 -6
- package/node_modules/diff/libcjs/convert/xml.d.ts.map +0 -1
- package/node_modules/diff/libcjs/convert/xml.js +0 -34
- package/node_modules/diff/libcjs/diff/array.d.ts +0 -19
- package/node_modules/diff/libcjs/diff/array.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/array.js +0 -40
- package/node_modules/diff/libcjs/diff/base.d.ts +0 -20
- package/node_modules/diff/libcjs/diff/base.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/base.js +0 -265
- package/node_modules/diff/libcjs/diff/character.d.ts +0 -19
- package/node_modules/diff/libcjs/diff/character.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/character.js +0 -31
- package/node_modules/diff/libcjs/diff/css.d.ts +0 -18
- package/node_modules/diff/libcjs/diff/css.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/css.js +0 -34
- package/node_modules/diff/libcjs/diff/json.d.ts +0 -24
- package/node_modules/diff/libcjs/diff/json.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/json.js +0 -105
- package/node_modules/diff/libcjs/diff/line.d.ts +0 -24
- package/node_modules/diff/libcjs/diff/line.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/line.js +0 -89
- package/node_modules/diff/libcjs/diff/sentence.d.ts +0 -21
- package/node_modules/diff/libcjs/diff/sentence.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/sentence.js +0 -67
- package/node_modules/diff/libcjs/diff/word.d.ts +0 -35
- package/node_modules/diff/libcjs/diff/word.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/word.js +0 -312
- package/node_modules/diff/libcjs/index.d.ts +0 -20
- package/node_modules/diff/libcjs/index.d.ts.map +0 -1
- package/node_modules/diff/libcjs/index.js +0 -64
- package/node_modules/diff/libcjs/package.json +0 -1
- package/node_modules/diff/libcjs/patch/apply.d.ts +0 -62
- package/node_modules/diff/libcjs/patch/apply.d.ts.map +0 -1
- package/node_modules/diff/libcjs/patch/apply.js +0 -267
- package/node_modules/diff/libcjs/patch/create.d.ts +0 -122
- package/node_modules/diff/libcjs/patch/create.d.ts.map +0 -1
- package/node_modules/diff/libcjs/patch/create.js +0 -251
- package/node_modules/diff/libcjs/patch/line-endings.d.ts +0 -17
- package/node_modules/diff/libcjs/patch/line-endings.d.ts.map +0 -1
- package/node_modules/diff/libcjs/patch/line-endings.js +0 -61
- package/node_modules/diff/libcjs/patch/parse.d.ts +0 -8
- package/node_modules/diff/libcjs/patch/parse.d.ts.map +0 -1
- package/node_modules/diff/libcjs/patch/parse.js +0 -150
- package/node_modules/diff/libcjs/patch/reverse.d.ts +0 -9
- package/node_modules/diff/libcjs/patch/reverse.d.ts.map +0 -1
- package/node_modules/diff/libcjs/patch/reverse.js +0 -37
- package/node_modules/diff/libcjs/types.d.ts +0 -213
- package/node_modules/diff/libcjs/types.d.ts.map +0 -1
- package/node_modules/diff/libcjs/types.js +0 -2
- package/node_modules/diff/libcjs/util/array.d.ts +0 -3
- package/node_modules/diff/libcjs/util/array.d.ts.map +0 -1
- package/node_modules/diff/libcjs/util/array.js +0 -21
- package/node_modules/diff/libcjs/util/distance-iterator.d.ts +0 -2
- package/node_modules/diff/libcjs/util/distance-iterator.d.ts.map +0 -1
- package/node_modules/diff/libcjs/util/distance-iterator.js +0 -40
- package/node_modules/diff/libcjs/util/params.d.ts +0 -4
- package/node_modules/diff/libcjs/util/params.d.ts.map +0 -1
- package/node_modules/diff/libcjs/util/params.js +0 -17
- package/node_modules/diff/libcjs/util/string.d.ts +0 -30
- package/node_modules/diff/libcjs/util/string.d.ts.map +0 -1
- package/node_modules/diff/libcjs/util/string.js +0 -200
- package/node_modules/diff/libesm/convert/dmp.d.ts +0 -8
- package/node_modules/diff/libesm/convert/dmp.d.ts.map +0 -1
- package/node_modules/diff/libesm/convert/dmp.js +0 -21
- package/node_modules/diff/libesm/convert/xml.d.ts +0 -6
- package/node_modules/diff/libesm/convert/xml.d.ts.map +0 -1
- package/node_modules/diff/libesm/convert/xml.js +0 -31
- package/node_modules/diff/libesm/diff/array.d.ts +0 -19
- package/node_modules/diff/libesm/diff/array.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/array.js +0 -16
- package/node_modules/diff/libesm/diff/base.d.ts +0 -20
- package/node_modules/diff/libesm/diff/base.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/base.js +0 -253
- package/node_modules/diff/libesm/diff/character.d.ts +0 -19
- package/node_modules/diff/libesm/diff/character.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/character.js +0 -7
- package/node_modules/diff/libesm/diff/css.d.ts +0 -18
- package/node_modules/diff/libesm/diff/css.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/css.js +0 -10
- package/node_modules/diff/libesm/diff/json.d.ts +0 -24
- package/node_modules/diff/libesm/diff/json.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/json.js +0 -78
- package/node_modules/diff/libesm/diff/line.d.ts +0 -24
- package/node_modules/diff/libesm/diff/line.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/line.js +0 -65
- package/node_modules/diff/libesm/diff/sentence.d.ts +0 -21
- package/node_modules/diff/libesm/diff/sentence.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/sentence.js +0 -43
- package/node_modules/diff/libesm/diff/word.d.ts +0 -35
- package/node_modules/diff/libesm/diff/word.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/word.js +0 -281
- package/node_modules/diff/libesm/index.d.ts +0 -20
- package/node_modules/diff/libesm/index.d.ts.map +0 -1
- package/node_modules/diff/libesm/index.js +0 -30
- package/node_modules/diff/libesm/package.json +0 -1
- package/node_modules/diff/libesm/patch/apply.d.ts +0 -62
- package/node_modules/diff/libesm/patch/apply.d.ts.map +0 -1
- package/node_modules/diff/libesm/patch/apply.js +0 -257
- package/node_modules/diff/libesm/patch/create.d.ts +0 -122
- package/node_modules/diff/libesm/patch/create.d.ts.map +0 -1
- package/node_modules/diff/libesm/patch/create.js +0 -228
- package/node_modules/diff/libesm/patch/line-endings.d.ts +0 -17
- package/node_modules/diff/libesm/patch/line-endings.d.ts.map +0 -1
- package/node_modules/diff/libesm/patch/line-endings.js +0 -44
- package/node_modules/diff/libesm/patch/parse.d.ts +0 -8
- package/node_modules/diff/libesm/patch/parse.d.ts.map +0 -1
- package/node_modules/diff/libesm/patch/parse.js +0 -147
- package/node_modules/diff/libesm/patch/reverse.d.ts +0 -9
- package/node_modules/diff/libesm/patch/reverse.d.ts.map +0 -1
- package/node_modules/diff/libesm/patch/reverse.js +0 -23
- package/node_modules/diff/libesm/types.d.ts +0 -213
- package/node_modules/diff/libesm/types.d.ts.map +0 -1
- package/node_modules/diff/libesm/types.js +0 -1
- package/node_modules/diff/libesm/util/array.d.ts +0 -3
- package/node_modules/diff/libesm/util/array.d.ts.map +0 -1
- package/node_modules/diff/libesm/util/array.js +0 -17
- package/node_modules/diff/libesm/util/distance-iterator.d.ts +0 -2
- package/node_modules/diff/libesm/util/distance-iterator.d.ts.map +0 -1
- package/node_modules/diff/libesm/util/distance-iterator.js +0 -37
- package/node_modules/diff/libesm/util/params.d.ts +0 -4
- package/node_modules/diff/libesm/util/params.d.ts.map +0 -1
- package/node_modules/diff/libesm/util/params.js +0 -14
- package/node_modules/diff/libesm/util/string.d.ts +0 -30
- package/node_modules/diff/libesm/util/string.d.ts.map +0 -1
- package/node_modules/diff/libesm/util/string.js +0 -184
- package/node_modules/diff/package.json +0 -130
- package/node_modules/diff/release-notes.md +0 -432
- package/node_modules/node-gyp/commitlint.config.mjs +0 -3
- package/node_modules/node-gyp/gyp/commitlint.config.js +0 -6
- package/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake_test.py +0 -105
- package/node_modules/node-gyp/zizmor.yml +0 -5
- package/node_modules/proxy-agent-negotiate/dist/index.d.ts +0 -14
- package/node_modules/proxy-agent-negotiate/dist/index.d.ts.map +0 -1
- package/node_modules/proxy-agent-negotiate/dist/index.js +0 -35
- package/node_modules/proxy-agent-negotiate/dist/index.js.map +0 -1
- package/node_modules/proxy-agent-negotiate/package.json +0 -47
- package/node_modules/undici/docs/docs/api/CacheStore.md +0 -360
- package/node_modules/undici/docs/docs/api/ClientStats.md +0 -93
- package/node_modules/undici/docs/docs/api/GlobalInstallation.md +0 -121
- package/node_modules/undici/docs/docs/api/H2CClient.md +0 -385
- package/node_modules/undici/docs/docs/api/Interceptors.md +0 -419
- package/node_modules/undici/docs/docs/api/MockCallHistory.md +0 -371
- package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +0 -206
- package/node_modules/undici/docs/docs/api/RoundRobinPool.md +0 -239
- package/node_modules/undici/docs/docs/api/SnapshotAgent.md +0 -361
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +0 -256
- package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +0 -233
- package/node_modules/undici/docs/docs/getting-started.md +0 -281
- package/node_modules/undici/docs/docs/site.json +0 -125
- package/node_modules/undici/docs/docs/type-map.json +0 -79
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +0 -110
- package/node_modules/undici/types/dispatcher1-wrapper.d.ts +0 -7
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/core/socks5-client.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/core/socks5-utils.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/encoding/index.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/llhttp/constants.d.ts +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/llhttp/utils.d.ts +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/snapshot-utils.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/date.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/stats.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/subresource-integrity/Readme.md +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/subresource-integrity/subresource-integrity.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/cache-interceptor.d.ts +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/client-stats.d.ts +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/mock-call-history.d.ts +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/utility.d.ts +0 -0
|
@@ -5,13 +5,16 @@ const { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols')
|
|
|
5
5
|
const { IncomingMessage } = require('node:http')
|
|
6
6
|
const stream = require('node:stream')
|
|
7
7
|
const net = require('node:net')
|
|
8
|
+
const { Blob } = require('node:buffer')
|
|
9
|
+
const nodeUtil = require('node:util')
|
|
8
10
|
const { stringify } = require('node:querystring')
|
|
9
|
-
const { EventEmitter: EE
|
|
10
|
-
const
|
|
11
|
-
const { InvalidArgumentError, ConnectTimeoutError } = require('./errors')
|
|
11
|
+
const { EventEmitter: EE } = require('node:events')
|
|
12
|
+
const { InvalidArgumentError } = require('./errors')
|
|
12
13
|
const { headerNameLowerCasedRecord } = require('./constants')
|
|
13
14
|
const { tree } = require('./tree')
|
|
14
15
|
|
|
16
|
+
const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
|
|
17
|
+
|
|
15
18
|
class BodyAsyncIterable {
|
|
16
19
|
constructor (body) {
|
|
17
20
|
this[kBody] = body
|
|
@@ -25,12 +28,6 @@ class BodyAsyncIterable {
|
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
function noop () {}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @param {*} body
|
|
32
|
-
* @returns {*}
|
|
33
|
-
*/
|
|
34
31
|
function wrapRequestBody (body) {
|
|
35
32
|
if (isStream(body)) {
|
|
36
33
|
// TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
|
|
@@ -56,8 +53,6 @@ function wrapRequestBody (body) {
|
|
|
56
53
|
// to determine whether or not it has been disturbed. This is just
|
|
57
54
|
// a workaround.
|
|
58
55
|
return new BodyAsyncIterable(body)
|
|
59
|
-
} else if (body && isFormDataLike(body)) {
|
|
60
|
-
return body
|
|
61
56
|
} else if (
|
|
62
57
|
body &&
|
|
63
58
|
typeof body !== 'string' &&
|
|
@@ -72,40 +67,32 @@ function wrapRequestBody (body) {
|
|
|
72
67
|
}
|
|
73
68
|
}
|
|
74
69
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
* @returns {obj is import('node:stream').Stream}
|
|
78
|
-
*/
|
|
70
|
+
function nop () {}
|
|
71
|
+
|
|
79
72
|
function isStream (obj) {
|
|
80
73
|
return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
|
|
81
74
|
}
|
|
82
75
|
|
|
83
|
-
|
|
84
|
-
* @param {*} object
|
|
85
|
-
* @returns {object is Blob}
|
|
86
|
-
*/
|
|
76
|
+
// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
|
|
87
77
|
function isBlobLike (object) {
|
|
88
|
-
|
|
89
|
-
|
|
78
|
+
if (object === null) {
|
|
79
|
+
return false
|
|
80
|
+
} else if (object instanceof Blob) {
|
|
81
|
+
return true
|
|
82
|
+
} else if (typeof object !== 'object') {
|
|
83
|
+
return false
|
|
84
|
+
} else {
|
|
85
|
+
const sTag = object[Symbol.toStringTag]
|
|
90
86
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
url.includes('?') ||
|
|
98
|
-
url.includes('#')
|
|
99
|
-
)
|
|
87
|
+
return (sTag === 'Blob' || sTag === 'File') && (
|
|
88
|
+
('stream' in object && typeof object.stream === 'function') ||
|
|
89
|
+
('arrayBuffer' in object && typeof object.arrayBuffer === 'function')
|
|
90
|
+
)
|
|
91
|
+
}
|
|
100
92
|
}
|
|
101
93
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
* @param {import('node:querystring').ParsedUrlQueryInput} queryParams The object to serialize into a URL query string
|
|
105
|
-
* @returns {string} The URL with the query params added
|
|
106
|
-
*/
|
|
107
|
-
function serializePathWithQuery (url, queryParams) {
|
|
108
|
-
if (pathHasQueryOrFragment(url)) {
|
|
94
|
+
function buildURL (url, queryParams) {
|
|
95
|
+
if (url.includes('?') || url.includes('#')) {
|
|
109
96
|
throw new Error('Query params cannot be passed when url already contains "?" or "#".')
|
|
110
97
|
}
|
|
111
98
|
|
|
@@ -118,10 +105,6 @@ function serializePathWithQuery (url, queryParams) {
|
|
|
118
105
|
return url
|
|
119
106
|
}
|
|
120
107
|
|
|
121
|
-
/**
|
|
122
|
-
* @param {number|string|undefined} port
|
|
123
|
-
* @returns {boolean}
|
|
124
|
-
*/
|
|
125
108
|
function isValidPort (port) {
|
|
126
109
|
const value = parseInt(port, 10)
|
|
127
110
|
return (
|
|
@@ -131,12 +114,6 @@ function isValidPort (port) {
|
|
|
131
114
|
)
|
|
132
115
|
}
|
|
133
116
|
|
|
134
|
-
/**
|
|
135
|
-
* Check if the value is a valid http or https prefixed string.
|
|
136
|
-
*
|
|
137
|
-
* @param {string} value
|
|
138
|
-
* @returns {boolean}
|
|
139
|
-
*/
|
|
140
117
|
function isHttpOrHttpsPrefixed (value) {
|
|
141
118
|
return (
|
|
142
119
|
value != null &&
|
|
@@ -154,15 +131,8 @@ function isHttpOrHttpsPrefixed (value) {
|
|
|
154
131
|
)
|
|
155
132
|
}
|
|
156
133
|
|
|
157
|
-
/**
|
|
158
|
-
* @param {string|URL|Record<string,string>} url
|
|
159
|
-
* @returns {URL}
|
|
160
|
-
*/
|
|
161
134
|
function parseURL (url) {
|
|
162
135
|
if (typeof url === 'string') {
|
|
163
|
-
/**
|
|
164
|
-
* @type {URL}
|
|
165
|
-
*/
|
|
166
136
|
url = new URL(url)
|
|
167
137
|
|
|
168
138
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
|
|
@@ -232,10 +202,6 @@ function parseURL (url) {
|
|
|
232
202
|
return url
|
|
233
203
|
}
|
|
234
204
|
|
|
235
|
-
/**
|
|
236
|
-
* @param {string|URL|Record<string, string>} url
|
|
237
|
-
* @returns {URL}
|
|
238
|
-
*/
|
|
239
205
|
function parseOrigin (url) {
|
|
240
206
|
url = parseURL(url)
|
|
241
207
|
|
|
@@ -246,10 +212,6 @@ function parseOrigin (url) {
|
|
|
246
212
|
return url
|
|
247
213
|
}
|
|
248
214
|
|
|
249
|
-
/**
|
|
250
|
-
* @param {string} host
|
|
251
|
-
* @returns {string}
|
|
252
|
-
*/
|
|
253
215
|
function getHostname (host) {
|
|
254
216
|
if (host[0] === '[') {
|
|
255
217
|
const idx = host.indexOf(']')
|
|
@@ -264,12 +226,8 @@ function getHostname (host) {
|
|
|
264
226
|
return host.substring(0, idx)
|
|
265
227
|
}
|
|
266
228
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
* Currently, the only server names supported are DNS hostnames
|
|
270
|
-
* @param {string|null} host
|
|
271
|
-
* @returns {string|null}
|
|
272
|
-
*/
|
|
229
|
+
// IP addresses are not valid server names per RFC6066
|
|
230
|
+
// > Currently, the only server names supported are DNS hostnames
|
|
273
231
|
function getServerName (host) {
|
|
274
232
|
if (!host) {
|
|
275
233
|
return null
|
|
@@ -285,50 +243,18 @@ function getServerName (host) {
|
|
|
285
243
|
return servername
|
|
286
244
|
}
|
|
287
245
|
|
|
288
|
-
/**
|
|
289
|
-
* @function
|
|
290
|
-
* @template T
|
|
291
|
-
* @param {T} obj
|
|
292
|
-
* @returns {T}
|
|
293
|
-
*/
|
|
294
246
|
function deepClone (obj) {
|
|
295
247
|
return JSON.parse(JSON.stringify(obj))
|
|
296
248
|
}
|
|
297
249
|
|
|
298
|
-
/**
|
|
299
|
-
* @param {*} obj
|
|
300
|
-
* @returns {obj is AsyncIterable}
|
|
301
|
-
*/
|
|
302
250
|
function isAsyncIterable (obj) {
|
|
303
251
|
return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
|
|
304
252
|
}
|
|
305
253
|
|
|
306
|
-
/**
|
|
307
|
-
* @param {*} obj
|
|
308
|
-
* @returns {obj is Iterable}
|
|
309
|
-
*/
|
|
310
254
|
function isIterable (obj) {
|
|
311
255
|
return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
|
|
312
256
|
}
|
|
313
257
|
|
|
314
|
-
/**
|
|
315
|
-
* Checks whether an object has a safe Symbol.iterator — i.e. one that is
|
|
316
|
-
* either own or inherited from a non-Object.prototype chain. This prevents
|
|
317
|
-
* prototype-pollution attacks from injecting a fake iterator on
|
|
318
|
-
* Object.prototype.
|
|
319
|
-
* @param {object} obj
|
|
320
|
-
* @returns {boolean}
|
|
321
|
-
*/
|
|
322
|
-
function hasSafeIterator (obj) {
|
|
323
|
-
const prototype = Object.getPrototypeOf(obj)
|
|
324
|
-
const ownIterator = Object.hasOwn(obj, Symbol.iterator)
|
|
325
|
-
return ownIterator || (prototype != null && prototype !== Object.prototype && typeof obj[Symbol.iterator] === 'function')
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* @param {Blob|Buffer|import ('stream').Stream} body
|
|
330
|
-
* @returns {number|null}
|
|
331
|
-
*/
|
|
332
258
|
function bodyLength (body) {
|
|
333
259
|
if (body == null) {
|
|
334
260
|
return 0
|
|
@@ -346,19 +272,10 @@ function bodyLength (body) {
|
|
|
346
272
|
return null
|
|
347
273
|
}
|
|
348
274
|
|
|
349
|
-
/**
|
|
350
|
-
* @param {import ('stream').Stream} body
|
|
351
|
-
* @returns {boolean}
|
|
352
|
-
*/
|
|
353
275
|
function isDestroyed (body) {
|
|
354
276
|
return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))
|
|
355
277
|
}
|
|
356
278
|
|
|
357
|
-
/**
|
|
358
|
-
* @param {import ('stream').Stream} stream
|
|
359
|
-
* @param {Error} [err]
|
|
360
|
-
* @returns {void}
|
|
361
|
-
*/
|
|
362
279
|
function destroy (stream, err) {
|
|
363
280
|
if (stream == null || !isStream(stream) || isDestroyed(stream)) {
|
|
364
281
|
return
|
|
@@ -370,12 +287,7 @@ function destroy (stream, err) {
|
|
|
370
287
|
stream.socket = null
|
|
371
288
|
}
|
|
372
289
|
|
|
373
|
-
|
|
374
|
-
stream.destroy(err)
|
|
375
|
-
} catch {
|
|
376
|
-
// stream.destroy may throw on managed sockets (e.g., http2).
|
|
377
|
-
// Silently ignore — the socket lifecycle is handled by the subsystem.
|
|
378
|
-
}
|
|
290
|
+
stream.destroy(err)
|
|
379
291
|
} else if (err) {
|
|
380
292
|
queueMicrotask(() => {
|
|
381
293
|
stream.emit('error', err)
|
|
@@ -388,12 +300,8 @@ function destroy (stream, err) {
|
|
|
388
300
|
}
|
|
389
301
|
|
|
390
302
|
const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
|
|
391
|
-
/**
|
|
392
|
-
* @param {string} val
|
|
393
|
-
* @returns {number | null}
|
|
394
|
-
*/
|
|
395
303
|
function parseKeepAliveTimeout (val) {
|
|
396
|
-
const m = val.match(KEEPALIVE_TIMEOUT_EXPR)
|
|
304
|
+
const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
|
|
397
305
|
return m ? parseInt(m[1], 10) * 1000 : null
|
|
398
306
|
}
|
|
399
307
|
|
|
@@ -418,219 +326,131 @@ function bufferToLowerCasedHeaderName (value) {
|
|
|
418
326
|
}
|
|
419
327
|
|
|
420
328
|
/**
|
|
421
|
-
* @param {(Buffer | string)[]} headers
|
|
329
|
+
* @param {Record<string, string | string[]> | (Buffer | string | (Buffer | string)[])[]} headers
|
|
422
330
|
* @param {Record<string, string | string[]>} [obj]
|
|
423
331
|
* @returns {Record<string, string | string[]>}
|
|
424
332
|
*/
|
|
425
333
|
function parseHeaders (headers, obj) {
|
|
426
334
|
if (obj === undefined) obj = {}
|
|
427
|
-
|
|
428
335
|
for (let i = 0; i < headers.length; i += 2) {
|
|
429
336
|
const key = headerNameToString(headers[i])
|
|
430
337
|
let val = obj[key]
|
|
431
338
|
|
|
432
|
-
if (val
|
|
433
|
-
if (
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
: Array.isArray(headers[i + 1])
|
|
437
|
-
? headers[i + 1].map(x => x.toString('latin1'))
|
|
438
|
-
: headers[i + 1].toString('latin1')
|
|
439
|
-
|
|
440
|
-
if (key === '__proto__') {
|
|
441
|
-
Object.defineProperty(obj, key, {
|
|
442
|
-
value: headersValue,
|
|
443
|
-
enumerable: true,
|
|
444
|
-
configurable: true,
|
|
445
|
-
writable: true
|
|
446
|
-
})
|
|
447
|
-
} else {
|
|
448
|
-
obj[key] = headersValue
|
|
449
|
-
}
|
|
450
|
-
} else {
|
|
451
|
-
if (typeof val === 'string') {
|
|
452
|
-
val = [val]
|
|
453
|
-
obj[key] = val
|
|
454
|
-
}
|
|
455
|
-
val.push(headers[i + 1].toString('latin1'))
|
|
339
|
+
if (val) {
|
|
340
|
+
if (typeof val === 'string') {
|
|
341
|
+
val = [val]
|
|
342
|
+
obj[key] = val
|
|
456
343
|
}
|
|
344
|
+
val.push(headers[i + 1].toString('utf8'))
|
|
457
345
|
} else {
|
|
458
|
-
const headersValue =
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
obj[key] = headersValue
|
|
346
|
+
const headersValue = headers[i + 1]
|
|
347
|
+
if (typeof headersValue === 'string') {
|
|
348
|
+
obj[key] = headersValue
|
|
349
|
+
} else {
|
|
350
|
+
obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')
|
|
351
|
+
}
|
|
465
352
|
}
|
|
466
353
|
}
|
|
467
354
|
|
|
355
|
+
// See https://github.com/nodejs/node/pull/46528
|
|
356
|
+
if ('content-length' in obj && 'content-disposition' in obj) {
|
|
357
|
+
obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
|
|
358
|
+
}
|
|
359
|
+
|
|
468
360
|
return obj
|
|
469
361
|
}
|
|
470
362
|
|
|
471
|
-
/**
|
|
472
|
-
* @param {Buffer[] | string[] | Record<string, string | string[]> | null | undefined} headers
|
|
473
|
-
* @returns {string[]}
|
|
474
|
-
*/
|
|
475
363
|
function parseRawHeaders (headers) {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
if (!Array.isArray(headers)) {
|
|
481
|
-
const rawHeaders = []
|
|
482
|
-
|
|
483
|
-
for (const [name, value] of Object.entries(headers)) {
|
|
484
|
-
if (Array.isArray(value)) {
|
|
485
|
-
for (const entry of value) {
|
|
486
|
-
rawHeaders.push(name, `${entry}`)
|
|
487
|
-
}
|
|
488
|
-
} else {
|
|
489
|
-
rawHeaders.push(name, `${value}`)
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
return rawHeaders
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
const headersLength = headers.length
|
|
497
|
-
/**
|
|
498
|
-
* @type {string[]}
|
|
499
|
-
*/
|
|
500
|
-
const ret = new Array(headersLength)
|
|
364
|
+
const len = headers.length
|
|
365
|
+
const ret = new Array(len)
|
|
501
366
|
|
|
367
|
+
let hasContentLength = false
|
|
368
|
+
let contentDispositionIdx = -1
|
|
502
369
|
let key
|
|
503
370
|
let val
|
|
371
|
+
let kLen = 0
|
|
504
372
|
|
|
505
|
-
for (let n = 0; n <
|
|
373
|
+
for (let n = 0; n < headers.length; n += 2) {
|
|
506
374
|
key = headers[n]
|
|
507
375
|
val = headers[n + 1]
|
|
508
376
|
|
|
509
377
|
typeof key !== 'string' && (key = key.toString())
|
|
510
|
-
typeof val !== 'string' && (val = val.toString('
|
|
378
|
+
typeof val !== 'string' && (val = val.toString('utf8'))
|
|
511
379
|
|
|
380
|
+
kLen = key.length
|
|
381
|
+
if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
|
|
382
|
+
hasContentLength = true
|
|
383
|
+
} else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
|
|
384
|
+
contentDispositionIdx = n + 1
|
|
385
|
+
}
|
|
512
386
|
ret[n] = key
|
|
513
387
|
ret[n + 1] = val
|
|
514
388
|
}
|
|
515
389
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* @param {Record<string, string | string[]>} headers
|
|
521
|
-
* @returns {Buffer[]}
|
|
522
|
-
*/
|
|
523
|
-
function toRawHeaders (headers) {
|
|
524
|
-
const rawHeaders = []
|
|
525
|
-
|
|
526
|
-
for (const [name, value] of Object.entries(headers)) {
|
|
527
|
-
if (Array.isArray(value)) {
|
|
528
|
-
for (const entry of value) {
|
|
529
|
-
rawHeaders.push(Buffer.from(name, 'latin1'), Buffer.from(`${entry}`, 'latin1'))
|
|
530
|
-
}
|
|
531
|
-
} else {
|
|
532
|
-
rawHeaders.push(Buffer.from(name, 'latin1'), Buffer.from(`${value}`, 'latin1'))
|
|
533
|
-
}
|
|
390
|
+
// See https://github.com/nodejs/node/pull/46528
|
|
391
|
+
if (hasContentLength && contentDispositionIdx !== -1) {
|
|
392
|
+
ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
|
|
534
393
|
}
|
|
535
394
|
|
|
536
|
-
return
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* @param {string[]} headers
|
|
541
|
-
* @param {Buffer[]} headers
|
|
542
|
-
*/
|
|
543
|
-
function encodeRawHeaders (headers) {
|
|
544
|
-
if (!Array.isArray(headers)) {
|
|
545
|
-
throw new TypeError('expected headers to be an array')
|
|
546
|
-
}
|
|
547
|
-
return headers.map(x => Buffer.from(x))
|
|
395
|
+
return ret
|
|
548
396
|
}
|
|
549
397
|
|
|
550
|
-
/**
|
|
551
|
-
* @param {*} buffer
|
|
552
|
-
* @returns {buffer is Buffer}
|
|
553
|
-
*/
|
|
554
398
|
function isBuffer (buffer) {
|
|
555
399
|
// See, https://github.com/mcollina/undici/pull/319
|
|
556
400
|
return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
|
|
557
401
|
}
|
|
558
402
|
|
|
559
|
-
|
|
560
|
-
* Asserts that the handler object is a request handler.
|
|
561
|
-
*
|
|
562
|
-
* @param {object} handler
|
|
563
|
-
* @param {string} method
|
|
564
|
-
* @param {string} [upgrade]
|
|
565
|
-
* @returns {asserts handler is import('../api/api-request').RequestHandler}
|
|
566
|
-
*/
|
|
567
|
-
function assertRequestHandler (handler, method, upgrade) {
|
|
403
|
+
function validateHandler (handler, method, upgrade) {
|
|
568
404
|
if (!handler || typeof handler !== 'object') {
|
|
569
405
|
throw new InvalidArgumentError('handler must be an object')
|
|
570
406
|
}
|
|
571
407
|
|
|
572
|
-
if (typeof handler.
|
|
573
|
-
throw new InvalidArgumentError('invalid
|
|
408
|
+
if (typeof handler.onConnect !== 'function') {
|
|
409
|
+
throw new InvalidArgumentError('invalid onConnect method')
|
|
574
410
|
}
|
|
575
411
|
|
|
576
|
-
if (typeof handler.
|
|
577
|
-
throw new InvalidArgumentError('invalid
|
|
412
|
+
if (typeof handler.onError !== 'function') {
|
|
413
|
+
throw new InvalidArgumentError('invalid onError method')
|
|
578
414
|
}
|
|
579
415
|
|
|
580
416
|
if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
|
|
581
417
|
throw new InvalidArgumentError('invalid onBodySent method')
|
|
582
418
|
}
|
|
583
419
|
|
|
584
|
-
if (typeof handler.onRequestSent !== 'function' && handler.onRequestSent !== undefined) {
|
|
585
|
-
throw new InvalidArgumentError('invalid onRequestSent method')
|
|
586
|
-
}
|
|
587
|
-
|
|
588
420
|
if (upgrade || method === 'CONNECT') {
|
|
589
|
-
if (typeof handler.
|
|
590
|
-
throw new InvalidArgumentError('invalid
|
|
421
|
+
if (typeof handler.onUpgrade !== 'function') {
|
|
422
|
+
throw new InvalidArgumentError('invalid onUpgrade method')
|
|
591
423
|
}
|
|
592
424
|
} else {
|
|
593
|
-
if (typeof handler.
|
|
594
|
-
throw new InvalidArgumentError('invalid
|
|
425
|
+
if (typeof handler.onHeaders !== 'function') {
|
|
426
|
+
throw new InvalidArgumentError('invalid onHeaders method')
|
|
595
427
|
}
|
|
596
428
|
|
|
597
|
-
if (typeof handler.
|
|
598
|
-
throw new InvalidArgumentError('invalid
|
|
429
|
+
if (typeof handler.onData !== 'function') {
|
|
430
|
+
throw new InvalidArgumentError('invalid onData method')
|
|
599
431
|
}
|
|
600
432
|
|
|
601
|
-
if (typeof handler.
|
|
602
|
-
throw new InvalidArgumentError('invalid
|
|
433
|
+
if (typeof handler.onComplete !== 'function') {
|
|
434
|
+
throw new InvalidArgumentError('invalid onComplete method')
|
|
603
435
|
}
|
|
604
436
|
}
|
|
605
437
|
}
|
|
606
438
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
* losing state or data.
|
|
610
|
-
* @param {import('node:stream').Readable} body
|
|
611
|
-
* @returns {boolean}
|
|
612
|
-
*/
|
|
439
|
+
// A body is disturbed if it has been read from and it cannot
|
|
440
|
+
// be re-used without losing state or data.
|
|
613
441
|
function isDisturbed (body) {
|
|
614
442
|
// TODO (fix): Why is body[kBodyUsed] needed?
|
|
615
443
|
return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))
|
|
616
444
|
}
|
|
617
445
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
* @property {number} [timeout]
|
|
626
|
-
* @property {number} bytesWritten
|
|
627
|
-
* @property {number} bytesRead
|
|
628
|
-
*/
|
|
446
|
+
function isErrored (body) {
|
|
447
|
+
return !!(body && stream.isErrored(body))
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function isReadable (body) {
|
|
451
|
+
return !!(body && stream.isReadable(body))
|
|
452
|
+
}
|
|
629
453
|
|
|
630
|
-
/**
|
|
631
|
-
* @param {import('net').Socket} socket
|
|
632
|
-
* @returns {SocketInfo}
|
|
633
|
-
*/
|
|
634
454
|
function getSocketInfo (socket) {
|
|
635
455
|
return {
|
|
636
456
|
localAddress: socket.localAddress,
|
|
@@ -644,12 +464,41 @@ function getSocketInfo (socket) {
|
|
|
644
464
|
}
|
|
645
465
|
}
|
|
646
466
|
|
|
647
|
-
/**
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
467
|
+
/** @type {globalThis['ReadableStream']} */
|
|
468
|
+
function ReadableStreamFrom (iterable) {
|
|
469
|
+
// We cannot use ReadableStream.from here because it does not return a byte stream.
|
|
470
|
+
|
|
471
|
+
let iterator
|
|
472
|
+
return new ReadableStream(
|
|
473
|
+
{
|
|
474
|
+
async start () {
|
|
475
|
+
iterator = iterable[Symbol.asyncIterator]()
|
|
476
|
+
},
|
|
477
|
+
async pull (controller) {
|
|
478
|
+
const { done, value } = await iterator.next()
|
|
479
|
+
if (done) {
|
|
480
|
+
queueMicrotask(() => {
|
|
481
|
+
controller.close()
|
|
482
|
+
controller.byobRequest?.respond(0)
|
|
483
|
+
})
|
|
484
|
+
} else {
|
|
485
|
+
const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
|
|
486
|
+
if (buf.byteLength) {
|
|
487
|
+
controller.enqueue(new Uint8Array(buf))
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
return controller.desiredSize > 0
|
|
491
|
+
},
|
|
492
|
+
async cancel (reason) {
|
|
493
|
+
await iterator.return()
|
|
494
|
+
},
|
|
495
|
+
type: 'bytes'
|
|
496
|
+
}
|
|
497
|
+
)
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
// The chunk should be a FormData instance and contains
|
|
501
|
+
// all the required methods.
|
|
653
502
|
function isFormDataLike (object) {
|
|
654
503
|
return (
|
|
655
504
|
object &&
|
|
@@ -665,58 +514,72 @@ function isFormDataLike (object) {
|
|
|
665
514
|
}
|
|
666
515
|
|
|
667
516
|
function addAbortListener (signal, listener) {
|
|
668
|
-
if (
|
|
669
|
-
return addAbortListenerNative(signal, listener)[Symbol.dispose]
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
if (typeof signal.addEventListener === 'function') {
|
|
517
|
+
if ('addEventListener' in signal) {
|
|
673
518
|
signal.addEventListener('abort', listener, { once: true })
|
|
674
519
|
return () => signal.removeEventListener('abort', listener)
|
|
675
520
|
}
|
|
676
|
-
signal.
|
|
521
|
+
signal.addListener('abort', listener)
|
|
677
522
|
return () => signal.removeListener('abort', listener)
|
|
678
523
|
}
|
|
679
524
|
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
])
|
|
525
|
+
const hasToWellFormed = typeof String.prototype.toWellFormed === 'function'
|
|
526
|
+
const hasIsWellFormed = typeof String.prototype.isWellFormed === 'function'
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* @param {string} val
|
|
530
|
+
*/
|
|
531
|
+
function toUSVString (val) {
|
|
532
|
+
return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val)
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* @param {string} val
|
|
537
|
+
*/
|
|
538
|
+
// TODO: move this to webidl
|
|
539
|
+
function isUSVString (val) {
|
|
540
|
+
return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`
|
|
541
|
+
}
|
|
698
542
|
|
|
699
543
|
/**
|
|
700
544
|
* @see https://tools.ietf.org/html/rfc7230#section-3.2.6
|
|
701
545
|
* @param {number} c
|
|
702
|
-
* @returns {boolean}
|
|
703
546
|
*/
|
|
704
547
|
function isTokenCharCode (c) {
|
|
705
|
-
|
|
548
|
+
switch (c) {
|
|
549
|
+
case 0x22:
|
|
550
|
+
case 0x28:
|
|
551
|
+
case 0x29:
|
|
552
|
+
case 0x2c:
|
|
553
|
+
case 0x2f:
|
|
554
|
+
case 0x3a:
|
|
555
|
+
case 0x3b:
|
|
556
|
+
case 0x3c:
|
|
557
|
+
case 0x3d:
|
|
558
|
+
case 0x3e:
|
|
559
|
+
case 0x3f:
|
|
560
|
+
case 0x40:
|
|
561
|
+
case 0x5b:
|
|
562
|
+
case 0x5c:
|
|
563
|
+
case 0x5d:
|
|
564
|
+
case 0x7b:
|
|
565
|
+
case 0x7d:
|
|
566
|
+
// DQUOTE and "(),/:;<=>?@[\]{}"
|
|
567
|
+
return false
|
|
568
|
+
default:
|
|
569
|
+
// VCHAR %x21-7E
|
|
570
|
+
return c >= 0x21 && c <= 0x7e
|
|
571
|
+
}
|
|
706
572
|
}
|
|
707
573
|
|
|
708
|
-
const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
|
|
709
|
-
|
|
710
574
|
/**
|
|
711
575
|
* @param {string} characters
|
|
712
|
-
* @returns {boolean}
|
|
713
576
|
*/
|
|
714
577
|
function isValidHTTPToken (characters) {
|
|
715
|
-
if (characters.length
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
for (let i = 0; i < characters.length; i
|
|
719
|
-
if (
|
|
578
|
+
if (characters.length === 0) {
|
|
579
|
+
return false
|
|
580
|
+
}
|
|
581
|
+
for (let i = 0; i < characters.length; ++i) {
|
|
582
|
+
if (!isTokenCharCode(characters.charCodeAt(i))) {
|
|
720
583
|
return false
|
|
721
584
|
}
|
|
722
585
|
}
|
|
@@ -736,48 +599,26 @@ const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
|
|
|
736
599
|
|
|
737
600
|
/**
|
|
738
601
|
* @param {string} characters
|
|
739
|
-
* @returns {boolean}
|
|
740
602
|
*/
|
|
741
603
|
function isValidHeaderValue (characters) {
|
|
742
604
|
return !headerCharRegex.test(characters)
|
|
743
605
|
}
|
|
744
606
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
/**
|
|
748
|
-
* @typedef {object} RangeHeader
|
|
749
|
-
* @property {number} start
|
|
750
|
-
* @property {number | null} end
|
|
751
|
-
* @property {number | null} size
|
|
752
|
-
*/
|
|
753
|
-
|
|
754
|
-
/**
|
|
755
|
-
* Parse accordingly to RFC 9110
|
|
756
|
-
* @see https://www.rfc-editor.org/rfc/rfc9110#field.content-range
|
|
757
|
-
* @param {string} [range]
|
|
758
|
-
* @returns {RangeHeader|null}
|
|
759
|
-
*/
|
|
607
|
+
// Parsed accordingly to RFC 9110
|
|
608
|
+
// https://www.rfc-editor.org/rfc/rfc9110#field.content-range
|
|
760
609
|
function parseRangeHeader (range) {
|
|
761
610
|
if (range == null || range === '') return { start: 0, end: null, size: null }
|
|
762
|
-
if (!range) return null
|
|
763
611
|
|
|
764
|
-
const m =
|
|
612
|
+
const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
|
|
765
613
|
return m
|
|
766
614
|
? {
|
|
767
615
|
start: parseInt(m[1]),
|
|
768
616
|
end: m[2] ? parseInt(m[2]) : null,
|
|
769
|
-
size: m[3]
|
|
617
|
+
size: m[3] ? parseInt(m[3]) : null
|
|
770
618
|
}
|
|
771
619
|
: null
|
|
772
620
|
}
|
|
773
621
|
|
|
774
|
-
/**
|
|
775
|
-
* @template {import("events").EventEmitter} T
|
|
776
|
-
* @param {T} obj
|
|
777
|
-
* @param {string} name
|
|
778
|
-
* @param {(...args: any[]) => void} listener
|
|
779
|
-
* @returns {T}
|
|
780
|
-
*/
|
|
781
622
|
function addListener (obj, name, listener) {
|
|
782
623
|
const listeners = (obj[kListeners] ??= [])
|
|
783
624
|
listeners.push([name, listener])
|
|
@@ -785,156 +626,24 @@ function addListener (obj, name, listener) {
|
|
|
785
626
|
return obj
|
|
786
627
|
}
|
|
787
628
|
|
|
788
|
-
/**
|
|
789
|
-
* @template {import("events").EventEmitter} T
|
|
790
|
-
* @param {T} obj
|
|
791
|
-
* @returns {T}
|
|
792
|
-
*/
|
|
793
629
|
function removeAllListeners (obj) {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
obj.removeListener(name, listener)
|
|
797
|
-
}
|
|
798
|
-
obj[kListeners] = null
|
|
630
|
+
for (const [name, listener] of obj[kListeners] ?? []) {
|
|
631
|
+
obj.removeListener(name, listener)
|
|
799
632
|
}
|
|
800
|
-
|
|
633
|
+
obj[kListeners] = null
|
|
801
634
|
}
|
|
802
635
|
|
|
803
|
-
/**
|
|
804
|
-
* @param {import ('../dispatcher/client')} client
|
|
805
|
-
* @param {import ('../core/request')} request
|
|
806
|
-
* @param {Error} err
|
|
807
|
-
*/
|
|
808
636
|
function errorRequest (client, request, err) {
|
|
809
637
|
try {
|
|
810
|
-
request.
|
|
638
|
+
request.onError(err)
|
|
811
639
|
assert(request.aborted)
|
|
812
640
|
} catch (err) {
|
|
813
641
|
client.emit('error', err)
|
|
814
642
|
}
|
|
815
643
|
}
|
|
816
644
|
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
* @param {object} opts
|
|
820
|
-
* @param {number} opts.timeout
|
|
821
|
-
* @param {string} opts.hostname
|
|
822
|
-
* @param {number} opts.port
|
|
823
|
-
* @returns {() => void}
|
|
824
|
-
*/
|
|
825
|
-
const setupConnectTimeout = process.platform === 'win32'
|
|
826
|
-
? (socketWeakRef, opts) => {
|
|
827
|
-
if (!opts.timeout) {
|
|
828
|
-
return noop
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
let s1 = null
|
|
832
|
-
let s2 = null
|
|
833
|
-
const fastTimer = timers.setFastTimeout(() => {
|
|
834
|
-
// setImmediate is added to make sure that we prioritize socket error events over timeouts
|
|
835
|
-
s1 = setImmediate(() => {
|
|
836
|
-
// Windows needs an extra setImmediate probably due to implementation differences in the socket logic
|
|
837
|
-
s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))
|
|
838
|
-
})
|
|
839
|
-
}, opts.timeout)
|
|
840
|
-
return () => {
|
|
841
|
-
timers.clearFastTimeout(fastTimer)
|
|
842
|
-
clearImmediate(s1)
|
|
843
|
-
clearImmediate(s2)
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
: (socketWeakRef, opts) => {
|
|
847
|
-
if (!opts.timeout) {
|
|
848
|
-
return noop
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
let s1 = null
|
|
852
|
-
const fastTimer = timers.setFastTimeout(() => {
|
|
853
|
-
// setImmediate is added to make sure that we prioritize socket error events over timeouts
|
|
854
|
-
s1 = setImmediate(() => {
|
|
855
|
-
onConnectTimeout(socketWeakRef.deref(), opts)
|
|
856
|
-
})
|
|
857
|
-
}, opts.timeout)
|
|
858
|
-
return () => {
|
|
859
|
-
timers.clearFastTimeout(fastTimer)
|
|
860
|
-
clearImmediate(s1)
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
* @param {net.Socket} socket
|
|
866
|
-
* @param {object} opts
|
|
867
|
-
* @param {number} opts.timeout
|
|
868
|
-
* @param {string} opts.hostname
|
|
869
|
-
* @param {number} opts.port
|
|
870
|
-
*/
|
|
871
|
-
function onConnectTimeout (socket, opts) {
|
|
872
|
-
// The socket could be already garbage collected
|
|
873
|
-
if (socket == null) {
|
|
874
|
-
return
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
let message = 'Connect Timeout Error'
|
|
878
|
-
if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {
|
|
879
|
-
message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`
|
|
880
|
-
} else {
|
|
881
|
-
message += ` (attempted address: ${opts.hostname}:${opts.port},`
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
message += ` timeout: ${opts.timeout}ms)`
|
|
885
|
-
|
|
886
|
-
destroy(socket, new ConnectTimeoutError(message))
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
let lastUrlString = null
|
|
890
|
-
let lastProtocol = null
|
|
891
|
-
|
|
892
|
-
/**
|
|
893
|
-
* @param {string} urlString
|
|
894
|
-
* @returns {string}
|
|
895
|
-
*/
|
|
896
|
-
function getProtocolFromUrlString (urlString) {
|
|
897
|
-
// Requests are typically dispatched against the same origin over and over,
|
|
898
|
-
// so cache the last (urlString, protocol) pair to skip re-parsing.
|
|
899
|
-
if (urlString === lastUrlString) {
|
|
900
|
-
return lastProtocol
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
const protocol = getProtocolFromUrlStringSlow(urlString)
|
|
904
|
-
lastUrlString = urlString
|
|
905
|
-
lastProtocol = protocol
|
|
906
|
-
|
|
907
|
-
return protocol
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
/**
|
|
911
|
-
* @param {string} urlString
|
|
912
|
-
* @returns {string}
|
|
913
|
-
*/
|
|
914
|
-
function getProtocolFromUrlStringSlow (urlString) {
|
|
915
|
-
if (
|
|
916
|
-
urlString[0] === 'h' &&
|
|
917
|
-
urlString[1] === 't' &&
|
|
918
|
-
urlString[2] === 't' &&
|
|
919
|
-
urlString[3] === 'p'
|
|
920
|
-
) {
|
|
921
|
-
switch (urlString[4]) {
|
|
922
|
-
case ':':
|
|
923
|
-
return 'http:'
|
|
924
|
-
case 's':
|
|
925
|
-
if (urlString[5] === ':') {
|
|
926
|
-
return 'https:'
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
// fallback if none of the usual suspects
|
|
931
|
-
return urlString.slice(0, urlString.indexOf(':') + 1)
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
const kEnumerableProperty = {
|
|
935
|
-
__proto__: null,
|
|
936
|
-
enumerable: true
|
|
937
|
-
}
|
|
645
|
+
const kEnumerableProperty = Object.create(null)
|
|
646
|
+
kEnumerableProperty.enumerable = true
|
|
938
647
|
|
|
939
648
|
const normalizedMethodRecordsBase = {
|
|
940
649
|
delete: 'DELETE',
|
|
@@ -948,9 +657,7 @@ const normalizedMethodRecordsBase = {
|
|
|
948
657
|
post: 'POST',
|
|
949
658
|
POST: 'POST',
|
|
950
659
|
put: 'PUT',
|
|
951
|
-
PUT: 'PUT'
|
|
952
|
-
query: 'QUERY',
|
|
953
|
-
QUERY: 'QUERY'
|
|
660
|
+
PUT: 'PUT'
|
|
954
661
|
}
|
|
955
662
|
|
|
956
663
|
const normalizedMethodRecords = {
|
|
@@ -965,14 +672,18 @@ Object.setPrototypeOf(normalizedMethodRecords, null)
|
|
|
965
672
|
|
|
966
673
|
module.exports = {
|
|
967
674
|
kEnumerableProperty,
|
|
675
|
+
nop,
|
|
968
676
|
isDisturbed,
|
|
677
|
+
isErrored,
|
|
678
|
+
isReadable,
|
|
679
|
+
toUSVString,
|
|
680
|
+
isUSVString,
|
|
969
681
|
isBlobLike,
|
|
970
682
|
parseOrigin,
|
|
971
683
|
parseURL,
|
|
972
684
|
getServerName,
|
|
973
685
|
isStream,
|
|
974
686
|
isIterable,
|
|
975
|
-
hasSafeIterator,
|
|
976
687
|
isAsyncIterable,
|
|
977
688
|
isDestroyed,
|
|
978
689
|
headerNameToString,
|
|
@@ -981,19 +692,17 @@ module.exports = {
|
|
|
981
692
|
removeAllListeners,
|
|
982
693
|
errorRequest,
|
|
983
694
|
parseRawHeaders,
|
|
984
|
-
toRawHeaders,
|
|
985
|
-
encodeRawHeaders,
|
|
986
695
|
parseHeaders,
|
|
987
696
|
parseKeepAliveTimeout,
|
|
988
697
|
destroy,
|
|
989
698
|
bodyLength,
|
|
990
699
|
deepClone,
|
|
700
|
+
ReadableStreamFrom,
|
|
991
701
|
isBuffer,
|
|
992
|
-
|
|
702
|
+
validateHandler,
|
|
993
703
|
getSocketInfo,
|
|
994
704
|
isFormDataLike,
|
|
995
|
-
|
|
996
|
-
serializePathWithQuery,
|
|
705
|
+
buildURL,
|
|
997
706
|
addAbortListener,
|
|
998
707
|
isValidHTTPToken,
|
|
999
708
|
isValidHeaderValue,
|
|
@@ -1003,8 +712,8 @@ module.exports = {
|
|
|
1003
712
|
normalizedMethodRecords,
|
|
1004
713
|
isValidPort,
|
|
1005
714
|
isHttpOrHttpsPrefixed,
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
715
|
+
nodeMajor,
|
|
716
|
+
nodeMinor,
|
|
717
|
+
safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'],
|
|
718
|
+
wrapRequestBody
|
|
1010
719
|
}
|