Update node types

131e60ffe639bdf27e13782fe56802b6b6ed7084

Cohee <18619528+Cohee1207@users.noreply.github.com>

3 files changed, +17 -18Ignore whitespace
package-lock.json+14 -13
@@ -71,6 +71,7 @@
7171 "@types/lodash": "^4.17.10",
7272 "@types/mime-types": "^2.1.4",
7373 "@types/multer": "^1.4.12",
74+ "@types/node": "^18.19.55",
7475 "@types/node-persist": "^3.1.8",
7576 "@types/png-chunk-text": "^1.0.3",
7677 "@types/png-chunks-encode": "^1.0.2",
@@ -1169,10 +1170,13 @@
11691170 }
11701171 },
11711172 "node_modules/@types/node": {
11721173 "version": "1618.919.155",
11731174 "resolved": "https://registry.npmjs.org/@types/node/-/node-1618.919.155.tgz",
11741175 "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQjzzw5Vw52205Zr/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7gnmErSEkN5FLqXPuKX/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cw==",
11751176 "license": "MIT",
1177+ "dependencies": {
1178+ "undici-types": "~5.26.4"
1179+ }
11761180 },
11771181 "node_modules/@types/node-fetch": {
11781182 "version": "2.6.11",
@@ -4031,6 +4035,12 @@
40314035 "@types/node": "16.9.1"
40324036 }
40334037 },
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+ },
40344044 "node_modules/import-fresh": {
40354045 "version": "3.3.0",
40364046 "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
@@ -4904,15 +4914,6 @@
49044914 "openai": "bin/cli"
49054915 }
49064916 },
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- },
49164917 "node_modules/openai/node_modules/node-fetch": {
49174918 "version": "2.7.0",
49184919 "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
package.json+1 -0
@@ -97,6 +97,7 @@
9797 "@types/lodash": "^4.17.10",
9898 "@types/mime-types": "^2.1.4",
9999 "@types/multer": "^1.4.12",
100+ "@types/node": "^18.19.55",
100101 "@types/node-persist": "^3.1.8",
101102 "@types/png-chunk-text": "^1.0.3",
102103 "@types/png-chunks-encode": "^1.0.2",
src/request-proxy.js+2 -5
@@ -1,11 +1,9 @@
11import process from 'node:process';
22import { createRequire }http from 'node:modulehttp';
3+import https from 'node:https';
34import { ProxyAgent } from 'proxy-agent';
45import { isValidUrl, color } from './util.js';
56
6-const require = createRequire(import.meta.url);
7-const http = require('http');
8-const https = require('https');
97const LOG_HEADER = '[Request Proxy]';
108
119/**
@@ -37,7 +35,6 @@ export default function initRequestProxy({ enabled, url, bypass }) {
3735 // Reference: https://github.com/Rob--W/proxy-from-env
3836 process.env.all_proxy = url;
3937
40-
4138 if (Array.isArray(bypass) && bypass.length > 0) {
4239 process.env.no_proxy = bypass.join(',');
4340 }