fix(feishu): honor proxy settings for REST and WebSocket

This commit is contained in:
xmanrui 2026-08-22 14:45:25 +08:00
parent b9ceac0779
commit f7d2fe7047
14 changed files with 467 additions and 188 deletions

View file

@ -142,6 +142,7 @@ for (const [name, version] of Object.entries(directDependencies)) {
const bundledBuildDependencies = {
'@larksuiteoapi/node-sdk': '1.73.0',
'@whiskeysockets/baileys': '7.0.0-rc14',
'https-proxy-agent': '5.0.1',
};
for (const [name, version] of Object.entries(bundledBuildDependencies)) {
if (manifest.dependencies?.[name] !== undefined) {
@ -157,8 +158,8 @@ if (lock.packages?.['node_modules/protobufjs']?.dev !== true) {
if (manifest.bin?.['dsh-im'] !== 'bin/dsh-im.mjs') {
throw new Error('package manifest must publish the dsh-im executable');
}
if (/(?:from\s*|import\s*\(|require\s*\()\s*["'](?:@larksuiteoapi\/node-sdk|@whiskeysockets\/baileys|protobufjs)(?:\/[^"']*)?["']/.test(host)) {
throw new Error('host bundle must not import a bundled SDK or protobufjs at runtime');
if (/(?:from\s*|import\s*\(|require\s*\()\s*["'](?:@larksuiteoapi\/node-sdk|@whiskeysockets\/baileys|https-proxy-agent|protobufjs)(?:\/[^"']*)?["']/.test(host)) {
throw new Error('host bundle must not import a bundled SDK, proxy agent, or protobufjs at runtime');
}
if ((executable.mode & 0o111) === 0) throw new Error('dsh-im CLI is not executable');
if (/private-bot-token|must-be-rolled-back|DEEPSEEK_API_KEY=/.test(client + host)) {