Merge branch 'main' into dev

This commit is contained in:
WJG 2024-06-17 19:28:26 +08:00
commit 8a629c4dd1
No known key found for this signature in database
GPG Key ID: 258474EF8590014A
3 changed files with 61 additions and 4 deletions

View File

@ -33,7 +33,8 @@
"https-proxy-agent": "^7.0.4",
"mi-service-lite": "^3.0.0",
"openai": "^4.51.0",
"prisma": "^5.14.0"
"prisma": "^5.14.0",
"socks-proxy-agent": "^8.0.3"
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",

View File

@ -26,6 +26,9 @@ importers:
prisma:
specifier: ^5.14.0
version: 5.14.0
socks-proxy-agent:
specifier: ^8.0.3
version: 8.0.3
devDependencies:
'@types/fs-extra':
specifier: ^11.0.4
@ -737,6 +740,10 @@ packages:
resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==}
engines: {node: '>= 4'}
ip-address@9.0.5:
resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==}
engines: {node: '>= 12'}
is-binary-path@2.1.0:
resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
engines: {node: '>=8'}
@ -772,6 +779,9 @@ packages:
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
engines: {node: '>=10'}
jsbn@1.1.0:
resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==}
jsonfile@6.1.0:
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
@ -965,10 +975,25 @@ packages:
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
engines: {node: '>=8'}
smart-buffer@4.2.0:
resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==}
engines: {node: '>= 6.0.0', npm: '>= 3.0.0'}
socks-proxy-agent@8.0.3:
resolution: {integrity: sha512-VNegTZKhuGq5vSD6XNKlbqWhyt/40CgoEw8XxD6dhnm8Jq9IEa3nIa4HwnM8XOqU0CdB0BwWVXusqiFXfHB3+A==}
engines: {node: '>= 14'}
socks@2.8.3:
resolution: {integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==}
engines: {node: '>= 10.0.0', npm: '>= 3.0.0'}
source-map@0.8.0-beta.0:
resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==}
engines: {node: '>= 8'}
sprintf-js@1.1.3:
resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==}
string-width@4.2.3:
resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
engines: {node: '>=8'}
@ -1692,6 +1717,11 @@ snapshots:
ignore@5.3.1: {}
ip-address@9.0.5:
dependencies:
jsbn: 1.1.0
sprintf-js: 1.1.3
is-binary-path@2.1.0:
dependencies:
binary-extensions: 2.3.0
@ -1718,6 +1748,8 @@ snapshots:
joycon@3.1.1: {}
jsbn@1.1.0: {}
jsonfile@6.1.0:
dependencies:
universalify: 2.0.1
@ -1888,10 +1920,27 @@ snapshots:
slash@3.0.0: {}
smart-buffer@4.2.0: {}
socks-proxy-agent@8.0.3:
dependencies:
agent-base: 7.1.1
debug: 4.3.4
socks: 2.8.3
transitivePeerDependencies:
- supports-color
socks@2.8.3:
dependencies:
ip-address: 9.0.5
smart-buffer: 4.2.0
source-map@0.8.0-beta.0:
dependencies:
whatwg-url: 7.1.0
sprintf-js@1.1.3: {}
string-width@4.2.3:
dependencies:
emoji-regex: 8.0.0

View File

@ -1,4 +1,11 @@
import { HttpsProxyAgent } from "https-proxy-agent";
export const kProxyAgent = process.env.HTTP_PROXY
? new HttpsProxyAgent(process.env.HTTP_PROXY)
import { SocksProxyAgent } from "socks-proxy-agent";
const httpProxy = process.env.HTTP_PROXY;
const socksProxy = process.env.SOCKS_PROXY;
export const kProxyAgent = httpProxy
? new HttpsProxyAgent(httpProxy)
: socksProxy
? new SocksProxyAgent(socksProxy)
: null;