Update node types
| @@ -71,6 +71,7 @@ | |||
| 71 | "@types/lodash": "^4.17.10", | 71 | "@types/lodash": "^4.17.10", |
| 72 | "@types/mime-types": "^2.1.4", | 72 | "@types/mime-types": "^2.1.4", |
| 73 | "@types/multer": "^1.4.12", | 73 | "@types/multer": "^1.4.12", |
| 74 | "@types/node": "^18.19.55", | ||
| 74 | "@types/node-persist": "^3.1.8", | 75 | "@types/node-persist": "^3.1.8", |
| 75 | "@types/png-chunk-text": "^1.0.3", | 76 | "@types/png-chunk-text": "^1.0.3", |
| 76 | "@types/png-chunks-encode": "^1.0.2", | 77 | "@types/png-chunks-encode": "^1.0.2", |
| @@ -1169,10 +1170,13 @@ | |||
| 1169 | } | 1170 | } |
| 1170 | }, | 1171 | }, |
| 1171 | "node_modules/@types/node": { | 1172 | "node_modules/@types/node": { |
| 1172 | "version": "16.9.1", | 1173 | "version": "18.19.55", |
| 1173 | "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", | 1174 | "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.55.tgz", |
| 1174 | "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==", | 1175 | "integrity": "sha512-zzw5Vw52205Zr/nmErSEkN5FLqXPuKX/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cw==", |
| 1175 | "license": "MIT" | 1176 | "license": "MIT", |
| 1177 | "dependencies": { | ||
| 1178 | "undici-types": "~5.26.4" | ||
| 1179 | } | ||
| 1176 | }, | 1180 | }, |
| 1177 | "node_modules/@types/node-fetch": { | 1181 | "node_modules/@types/node-fetch": { |
| 1178 | "version": "2.6.11", | 1182 | "version": "2.6.11", |
| @@ -4031,6 +4035,12 @@ | |||
| 4031 | "@types/node": "16.9.1" | 4035 | "@types/node": "16.9.1" |
| 4032 | } | 4036 | } |
| 4033 | }, | 4037 | }, |
| 4038 | "node_modules/image-q/node_modules/@types/node": { | ||
| 4039 | "version": "16.9.1", | ||
| 4040 | "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", | ||
| 4041 | "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==", | ||
| 4042 | "license": "MIT" | ||
| 4043 | }, | ||
| 4034 | "node_modules/import-fresh": { | 4044 | "node_modules/import-fresh": { |
| 4035 | "version": "3.3.0", | 4045 | "version": "3.3.0", |
| 4036 | "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", | 4046 | "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", |
| @@ -4904,15 +4914,6 @@ | |||
| 4904 | "openai": "bin/cli" | 4914 | "openai": "bin/cli" |
| 4905 | } | 4915 | } |
| 4906 | }, | 4916 | }, |
| 4907 | "node_modules/openai/node_modules/@types/node": { | ||
| 4908 | "version": "18.18.9", | ||
| 4909 | "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.9.tgz", | ||
| 4910 | "integrity": "sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ==", | ||
| 4911 | "license": "MIT", | ||
| 4912 | "dependencies": { | ||
| 4913 | "undici-types": "~5.26.4" | ||
| 4914 | } | ||
| 4915 | }, | ||
| 4916 | "node_modules/openai/node_modules/node-fetch": { | 4917 | "node_modules/openai/node_modules/node-fetch": { |
| 4917 | "version": "2.7.0", | 4918 | "version": "2.7.0", |
| 4918 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", | 4919 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", |
| @@ -97,6 +97,7 @@ | |||
| 97 | "@types/lodash": "^4.17.10", | 97 | "@types/lodash": "^4.17.10", |
| 98 | "@types/mime-types": "^2.1.4", | 98 | "@types/mime-types": "^2.1.4", |
| 99 | "@types/multer": "^1.4.12", | 99 | "@types/multer": "^1.4.12", |
| 100 | "@types/node": "^18.19.55", | ||
| 100 | "@types/node-persist": "^3.1.8", | 101 | "@types/node-persist": "^3.1.8", |
| 101 | "@types/png-chunk-text": "^1.0.3", | 102 | "@types/png-chunk-text": "^1.0.3", |
| 102 | "@types/png-chunks-encode": "^1.0.2", | 103 | "@types/png-chunks-encode": "^1.0.2", |
| @@ -1,11 +1,9 @@ | |||
| 1 | import process from 'node:process'; | 1 | import process from 'node:process'; |
| 2 | import { createRequire } from 'node:module'; | 2 | import http from 'node:http'; |
| 3 | import https from 'node:https'; | ||
| 3 | import { ProxyAgent } from 'proxy-agent'; | 4 | import { ProxyAgent } from 'proxy-agent'; |
| 4 | import { isValidUrl, color } from './util.js'; | 5 | import { isValidUrl, color } from './util.js'; |
| 5 | 6 | ||
| 6 | const require = createRequire(import.meta.url); | ||
| 7 | const http = require('http'); | ||
| 8 | const https = require('https'); | ||
| 9 | const LOG_HEADER = '[Request Proxy]'; | 7 | const LOG_HEADER = '[Request Proxy]'; |
| 10 | 8 | ||
| 11 | /** | 9 | /** |
| @@ -37,7 +35,6 @@ export default function initRequestProxy({ enabled, url, bypass }) { | |||
| 37 | // Reference: https://github.com/Rob--W/proxy-from-env | 35 | // Reference: https://github.com/Rob--W/proxy-from-env |
| 38 | process.env.all_proxy = url; | 36 | process.env.all_proxy = url; |
| 39 | 37 | ||
| 40 | |||
| 41 | if (Array.isArray(bypass) && bypass.length > 0) { | 38 | if (Array.isArray(bypass) && bypass.length > 0) { |
| 42 | process.env.no_proxy = bypass.join(','); | 39 | process.env.no_proxy = bypass.join(','); |
| 43 | } | 40 | } |