qwenproxy-cli 1.6.8 → 1.6.9
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/dist/clean-cache.js +7 -4
- package/dist/delete-chats.js +10 -10
- package/dist/index.js +11 -11
- package/dist/login.js +7 -7
- package/dist/reset-cooldowns.js +7 -4
- package/dist/sync-clients.js +1 -1
- package/package.json +1 -1
- package/src/core/config.ts +1 -1
- package/src/core/version.ts +1 -1
- package/src/services/auth-playwright.ts +1 -1
- package/src/services/playwright.ts +6 -6
- package/src/services/qwen.ts +3 -3
package/dist/clean-cache.js
CHANGED
|
@@ -997,7 +997,7 @@ var init_config = __esm({
|
|
|
997
997
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
998
998
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
999
999
|
// Override via env when Qwen ships a new bundle.
|
|
1000
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
1000
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
1001
1001
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
1002
1002
|
// (chats/new, settings): those work without them (live-probed). The
|
|
1003
1003
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
|
@@ -2726,6 +2726,9 @@ function updateQwenWebVersion(version) {
|
|
|
2726
2726
|
dynamicWebVersion = version.trim();
|
|
2727
2727
|
}
|
|
2728
2728
|
}
|
|
2729
|
+
function getQwenWebVersion() {
|
|
2730
|
+
return dynamicWebVersion || config.qwen.webVersion;
|
|
2731
|
+
}
|
|
2729
2732
|
var dynamicWebVersion, QWEN_WEB_VERSION, DEFAULT_QWEN_USER_AGENT, QWEN_TIMEZONE_HEADER;
|
|
2730
2733
|
var init_qwen_headers = __esm({
|
|
2731
2734
|
"src/services/qwen-headers.ts"() {
|
|
@@ -4097,7 +4100,7 @@ async function loginViaApi(page, email, password) {
|
|
|
4097
4100
|
accept: "application/json, text/plain, */*",
|
|
4098
4101
|
"content-type": "application/json",
|
|
4099
4102
|
source: "web",
|
|
4100
|
-
version: "0.3.
|
|
4103
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4101
4104
|
"x-request-origin": "https://chat.qwen.ai",
|
|
4102
4105
|
timezone: tz,
|
|
4103
4106
|
"x-request-id": requestId2
|
|
@@ -4129,7 +4132,7 @@ async function loginViaApi(page, email, password) {
|
|
|
4129
4132
|
accept: "application/json, text/plain, */*",
|
|
4130
4133
|
"content-type": "application/json",
|
|
4131
4134
|
source: "web",
|
|
4132
|
-
version: "0.3.
|
|
4135
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4133
4136
|
timezone: tz,
|
|
4134
4137
|
"x-request-id": requestId2
|
|
4135
4138
|
},
|
|
@@ -4481,7 +4484,7 @@ async function refreshAccountToken(accountId) {
|
|
|
4481
4484
|
headers: {
|
|
4482
4485
|
accept: "application/json, text/plain, */*",
|
|
4483
4486
|
source: "web",
|
|
4484
|
-
version: "0.3.
|
|
4487
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4485
4488
|
"x-request-origin": "https://chat.qwen.ai",
|
|
4486
4489
|
timezone: tz,
|
|
4487
4490
|
authorization: `Bearer ${rTok}`
|
package/dist/delete-chats.js
CHANGED
|
@@ -1093,7 +1093,7 @@ var init_config = __esm({
|
|
|
1093
1093
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
1094
1094
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
1095
1095
|
// Override via env when Qwen ships a new bundle.
|
|
1096
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
1096
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
1097
1097
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
1098
1098
|
// (chats/new, settings): those work without them (live-probed). The
|
|
1099
1099
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
|
@@ -4978,7 +4978,7 @@ async function startEmailOtpLogin(email, options = {}) {
|
|
|
4978
4978
|
{
|
|
4979
4979
|
email: normalizedEmail,
|
|
4980
4980
|
requestId,
|
|
4981
|
-
version: getQwenWebVersion() || "0.3.
|
|
4981
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4982
4982
|
timezone: formatAsciiTimezone()
|
|
4983
4983
|
}
|
|
4984
4984
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -5073,7 +5073,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
5073
5073
|
email: session.email,
|
|
5074
5074
|
code: cleanCode,
|
|
5075
5075
|
requestId,
|
|
5076
|
-
version: getQwenWebVersion() || "0.3.
|
|
5076
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5077
5077
|
timezone: formatAsciiTimezone()
|
|
5078
5078
|
}
|
|
5079
5079
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -5121,7 +5121,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
5121
5121
|
cookie: `token=${accessToken}`,
|
|
5122
5122
|
userAgent: session.fingerprint.userAgent,
|
|
5123
5123
|
bxV: "2.5.37",
|
|
5124
|
-
version: getQwenWebVersion() || "0.3.
|
|
5124
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5125
5125
|
userId: userId || void 0,
|
|
5126
5126
|
tokenExpiresAt: exp || void 0,
|
|
5127
5127
|
refreshToken: refreshToken || void 0,
|
|
@@ -5365,7 +5365,7 @@ async function loginViaApi(page, email, password) {
|
|
|
5365
5365
|
accept: "application/json, text/plain, */*",
|
|
5366
5366
|
"content-type": "application/json",
|
|
5367
5367
|
source: "web",
|
|
5368
|
-
version: "0.3.
|
|
5368
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5369
5369
|
"x-request-origin": "https://chat.qwen.ai",
|
|
5370
5370
|
timezone: tz,
|
|
5371
5371
|
"x-request-id": requestId2
|
|
@@ -5397,7 +5397,7 @@ async function loginViaApi(page, email, password) {
|
|
|
5397
5397
|
accept: "application/json, text/plain, */*",
|
|
5398
5398
|
"content-type": "application/json",
|
|
5399
5399
|
source: "web",
|
|
5400
|
-
version: "0.3.
|
|
5400
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5401
5401
|
timezone: tz,
|
|
5402
5402
|
"x-request-id": requestId2
|
|
5403
5403
|
},
|
|
@@ -5749,7 +5749,7 @@ async function refreshAccountToken(accountId) {
|
|
|
5749
5749
|
headers: {
|
|
5750
5750
|
accept: "application/json, text/plain, */*",
|
|
5751
5751
|
source: "web",
|
|
5752
|
-
version: "0.3.
|
|
5752
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5753
5753
|
"x-request-origin": "https://chat.qwen.ai",
|
|
5754
5754
|
timezone: tz,
|
|
5755
5755
|
authorization: `Bearer ${rTok}`
|
|
@@ -7233,7 +7233,7 @@ async function getBasicHeaders2(accountId) {
|
|
|
7233
7233
|
secChUa: "",
|
|
7234
7234
|
secChUaMobile: "?0",
|
|
7235
7235
|
secChUaPlatform: "",
|
|
7236
|
-
version: "0.
|
|
7236
|
+
version: "0.3.26"
|
|
7237
7237
|
};
|
|
7238
7238
|
}
|
|
7239
7239
|
const resolvedAccountId = accountId ?? loadAccounts()[0]?.id;
|
|
@@ -10102,7 +10102,7 @@ async function deleteSingleQwenChat(accountId, chatId) {
|
|
|
10102
10102
|
}
|
|
10103
10103
|
const requestHeaders = {
|
|
10104
10104
|
source: "web",
|
|
10105
|
-
version: "0.
|
|
10105
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
10106
10106
|
timezone: formatAsciiTimezone(),
|
|
10107
10107
|
"x-request-id": crypto5.randomUUID(),
|
|
10108
10108
|
Referer: qwenUrl(`/c/${encodeURIComponent(chatId)}`)
|
|
@@ -10146,7 +10146,7 @@ async function fetchRemoteQwenChats(accountId) {
|
|
|
10146
10146
|
return [];
|
|
10147
10147
|
}
|
|
10148
10148
|
const requestHeaders = {
|
|
10149
|
-
version: "0.
|
|
10149
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
10150
10150
|
timezone: formatAsciiTimezone(),
|
|
10151
10151
|
"x-request-id": crypto5.randomUUID(),
|
|
10152
10152
|
Referer: qwenUrl("/settings/chats")
|
package/dist/index.js
CHANGED
|
@@ -266,7 +266,7 @@ var init_config = __esm({
|
|
|
266
266
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
267
267
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
268
268
|
// Override via env when Qwen ships a new bundle.
|
|
269
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
269
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
270
270
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
271
271
|
// (chats/new, settings): those work without them (live-probed). The
|
|
272
272
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
|
@@ -6088,7 +6088,7 @@ async function startEmailOtpLogin(email, options = {}) {
|
|
|
6088
6088
|
{
|
|
6089
6089
|
email: normalizedEmail,
|
|
6090
6090
|
requestId,
|
|
6091
|
-
version: getQwenWebVersion() || "0.3.
|
|
6091
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6092
6092
|
timezone: formatAsciiTimezone()
|
|
6093
6093
|
}
|
|
6094
6094
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -6183,7 +6183,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
6183
6183
|
email: session.email,
|
|
6184
6184
|
code: cleanCode,
|
|
6185
6185
|
requestId,
|
|
6186
|
-
version: getQwenWebVersion() || "0.3.
|
|
6186
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6187
6187
|
timezone: formatAsciiTimezone()
|
|
6188
6188
|
}
|
|
6189
6189
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -6231,7 +6231,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
6231
6231
|
cookie: `token=${accessToken}`,
|
|
6232
6232
|
userAgent: session.fingerprint.userAgent,
|
|
6233
6233
|
bxV: "2.5.37",
|
|
6234
|
-
version: getQwenWebVersion() || "0.3.
|
|
6234
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6235
6235
|
userId: userId || void 0,
|
|
6236
6236
|
tokenExpiresAt: exp || void 0,
|
|
6237
6237
|
refreshToken: refreshToken || void 0,
|
|
@@ -6475,7 +6475,7 @@ async function loginViaApi(page, email, password) {
|
|
|
6475
6475
|
accept: "application/json, text/plain, */*",
|
|
6476
6476
|
"content-type": "application/json",
|
|
6477
6477
|
source: "web",
|
|
6478
|
-
version: "0.3.
|
|
6478
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6479
6479
|
"x-request-origin": "https://chat.qwen.ai",
|
|
6480
6480
|
timezone: tz,
|
|
6481
6481
|
"x-request-id": requestId2
|
|
@@ -6507,7 +6507,7 @@ async function loginViaApi(page, email, password) {
|
|
|
6507
6507
|
accept: "application/json, text/plain, */*",
|
|
6508
6508
|
"content-type": "application/json",
|
|
6509
6509
|
source: "web",
|
|
6510
|
-
version: "0.3.
|
|
6510
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6511
6511
|
timezone: tz,
|
|
6512
6512
|
"x-request-id": requestId2
|
|
6513
6513
|
},
|
|
@@ -6859,7 +6859,7 @@ async function refreshAccountToken(accountId) {
|
|
|
6859
6859
|
headers: {
|
|
6860
6860
|
accept: "application/json, text/plain, */*",
|
|
6861
6861
|
source: "web",
|
|
6862
|
-
version: "0.3.
|
|
6862
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6863
6863
|
"x-request-origin": "https://chat.qwen.ai",
|
|
6864
6864
|
timezone: tz,
|
|
6865
6865
|
authorization: `Bearer ${rTok}`
|
|
@@ -8581,7 +8581,7 @@ async function getBasicHeaders2(accountId) {
|
|
|
8581
8581
|
secChUa: "",
|
|
8582
8582
|
secChUaMobile: "?0",
|
|
8583
8583
|
secChUaPlatform: "",
|
|
8584
|
-
version: "0.
|
|
8584
|
+
version: "0.3.26"
|
|
8585
8585
|
};
|
|
8586
8586
|
}
|
|
8587
8587
|
const resolvedAccountId = accountId ?? loadAccounts()[0]?.id;
|
|
@@ -13292,7 +13292,7 @@ async function deleteSingleQwenChat(accountId, chatId) {
|
|
|
13292
13292
|
}
|
|
13293
13293
|
const requestHeaders = {
|
|
13294
13294
|
source: "web",
|
|
13295
|
-
version: "0.
|
|
13295
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
13296
13296
|
timezone: formatAsciiTimezone(),
|
|
13297
13297
|
"x-request-id": crypto7.randomUUID(),
|
|
13298
13298
|
Referer: qwenUrl(`/c/${encodeURIComponent(chatId)}`)
|
|
@@ -13336,7 +13336,7 @@ async function fetchRemoteQwenChats(accountId) {
|
|
|
13336
13336
|
return [];
|
|
13337
13337
|
}
|
|
13338
13338
|
const requestHeaders = {
|
|
13339
|
-
version: "0.
|
|
13339
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
13340
13340
|
timezone: formatAsciiTimezone(),
|
|
13341
13341
|
"x-request-id": crypto7.randomUUID(),
|
|
13342
13342
|
Referer: qwenUrl("/settings/chats")
|
|
@@ -27095,7 +27095,7 @@ function getAppVersion() {
|
|
|
27095
27095
|
}
|
|
27096
27096
|
} catch {
|
|
27097
27097
|
}
|
|
27098
|
-
cachedVersion = "v1.6.
|
|
27098
|
+
cachedVersion = "v1.6.9";
|
|
27099
27099
|
return cachedVersion;
|
|
27100
27100
|
}
|
|
27101
27101
|
var cachedVersion;
|
package/dist/login.js
CHANGED
|
@@ -1228,7 +1228,7 @@ var init_config = __esm({
|
|
|
1228
1228
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
1229
1229
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
1230
1230
|
// Override via env when Qwen ships a new bundle.
|
|
1231
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
1231
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
1232
1232
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
1233
1233
|
// (chats/new, settings): those work without them (live-probed). The
|
|
1234
1234
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
|
@@ -4951,7 +4951,7 @@ async function startEmailOtpLogin(email, options = {}) {
|
|
|
4951
4951
|
{
|
|
4952
4952
|
email: normalizedEmail,
|
|
4953
4953
|
requestId,
|
|
4954
|
-
version: getQwenWebVersion() || "0.3.
|
|
4954
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4955
4955
|
timezone: formatAsciiTimezone()
|
|
4956
4956
|
}
|
|
4957
4957
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -5046,7 +5046,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
5046
5046
|
email: session.email,
|
|
5047
5047
|
code: cleanCode,
|
|
5048
5048
|
requestId,
|
|
5049
|
-
version: getQwenWebVersion() || "0.3.
|
|
5049
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5050
5050
|
timezone: formatAsciiTimezone()
|
|
5051
5051
|
}
|
|
5052
5052
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -5094,7 +5094,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
5094
5094
|
cookie: `token=${accessToken}`,
|
|
5095
5095
|
userAgent: session.fingerprint.userAgent,
|
|
5096
5096
|
bxV: "2.5.37",
|
|
5097
|
-
version: getQwenWebVersion() || "0.3.
|
|
5097
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5098
5098
|
userId: userId || void 0,
|
|
5099
5099
|
tokenExpiresAt: exp || void 0,
|
|
5100
5100
|
refreshToken: refreshToken || void 0,
|
|
@@ -5338,7 +5338,7 @@ async function loginViaApi(page, email, password) {
|
|
|
5338
5338
|
accept: "application/json, text/plain, */*",
|
|
5339
5339
|
"content-type": "application/json",
|
|
5340
5340
|
source: "web",
|
|
5341
|
-
version: "0.3.
|
|
5341
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5342
5342
|
"x-request-origin": "https://chat.qwen.ai",
|
|
5343
5343
|
timezone: tz,
|
|
5344
5344
|
"x-request-id": requestId2
|
|
@@ -5370,7 +5370,7 @@ async function loginViaApi(page, email, password) {
|
|
|
5370
5370
|
accept: "application/json, text/plain, */*",
|
|
5371
5371
|
"content-type": "application/json",
|
|
5372
5372
|
source: "web",
|
|
5373
|
-
version: "0.3.
|
|
5373
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5374
5374
|
timezone: tz,
|
|
5375
5375
|
"x-request-id": requestId2
|
|
5376
5376
|
},
|
|
@@ -5722,7 +5722,7 @@ async function refreshAccountToken(accountId) {
|
|
|
5722
5722
|
headers: {
|
|
5723
5723
|
accept: "application/json, text/plain, */*",
|
|
5724
5724
|
source: "web",
|
|
5725
|
-
version: "0.3.
|
|
5725
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5726
5726
|
"x-request-origin": "https://chat.qwen.ai",
|
|
5727
5727
|
timezone: tz,
|
|
5728
5728
|
authorization: `Bearer ${rTok}`
|
package/dist/reset-cooldowns.js
CHANGED
|
@@ -1334,7 +1334,7 @@ var init_config = __esm({
|
|
|
1334
1334
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
1335
1335
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
1336
1336
|
// Override via env when Qwen ships a new bundle.
|
|
1337
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
1337
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
1338
1338
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
1339
1339
|
// (chats/new, settings): those work without them (live-probed). The
|
|
1340
1340
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
|
@@ -2768,6 +2768,9 @@ function updateQwenWebVersion(version) {
|
|
|
2768
2768
|
dynamicWebVersion = version.trim();
|
|
2769
2769
|
}
|
|
2770
2770
|
}
|
|
2771
|
+
function getQwenWebVersion() {
|
|
2772
|
+
return dynamicWebVersion || config.qwen.webVersion;
|
|
2773
|
+
}
|
|
2771
2774
|
var dynamicWebVersion, QWEN_WEB_VERSION, DEFAULT_QWEN_USER_AGENT, QWEN_TIMEZONE_HEADER;
|
|
2772
2775
|
var init_qwen_headers = __esm({
|
|
2773
2776
|
"src/services/qwen-headers.ts"() {
|
|
@@ -4363,7 +4366,7 @@ async function loginViaApi(page, email, password) {
|
|
|
4363
4366
|
accept: "application/json, text/plain, */*",
|
|
4364
4367
|
"content-type": "application/json",
|
|
4365
4368
|
source: "web",
|
|
4366
|
-
version: "0.3.
|
|
4369
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4367
4370
|
"x-request-origin": "https://chat.qwen.ai",
|
|
4368
4371
|
timezone: tz,
|
|
4369
4372
|
"x-request-id": requestId2
|
|
@@ -4395,7 +4398,7 @@ async function loginViaApi(page, email, password) {
|
|
|
4395
4398
|
accept: "application/json, text/plain, */*",
|
|
4396
4399
|
"content-type": "application/json",
|
|
4397
4400
|
source: "web",
|
|
4398
|
-
version: "0.3.
|
|
4401
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4399
4402
|
timezone: tz,
|
|
4400
4403
|
"x-request-id": requestId2
|
|
4401
4404
|
},
|
|
@@ -4747,7 +4750,7 @@ async function refreshAccountToken(accountId) {
|
|
|
4747
4750
|
headers: {
|
|
4748
4751
|
accept: "application/json, text/plain, */*",
|
|
4749
4752
|
source: "web",
|
|
4750
|
-
version: "0.3.
|
|
4753
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4751
4754
|
"x-request-origin": "https://chat.qwen.ai",
|
|
4752
4755
|
timezone: tz,
|
|
4753
4756
|
authorization: `Bearer ${rTok}`
|
package/dist/sync-clients.js
CHANGED
|
@@ -119,7 +119,7 @@ var envSchema = z.object({
|
|
|
119
119
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
120
120
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
121
121
|
// Override via env when Qwen ships a new bundle.
|
|
122
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
122
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
123
123
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
124
124
|
// (chats/new, settings): those work without them (live-probed). The
|
|
125
125
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qwenproxy-cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.9",
|
|
4
4
|
"description": "High-performance OpenAI & Anthropic compatible API gateway for Qwen with multi-account rotation, interactive TUI, and resilient tool calling.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"bin": {
|
package/src/core/config.ts
CHANGED
|
@@ -34,7 +34,7 @@ const envSchema = z
|
|
|
34
34
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
35
35
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
36
36
|
// Override via env when Qwen ships a new bundle.
|
|
37
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
37
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
38
38
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
39
39
|
// (chats/new, settings): those work without them (live-probed). The
|
|
40
40
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
package/src/core/version.ts
CHANGED
|
@@ -2193,7 +2193,7 @@ export async function startEmailOtpLogin(
|
|
|
2193
2193
|
{
|
|
2194
2194
|
email: normalizedEmail,
|
|
2195
2195
|
requestId,
|
|
2196
|
-
version: getQwenWebVersion() || "0.3.
|
|
2196
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2197
2197
|
timezone: formatAsciiTimezone(),
|
|
2198
2198
|
},
|
|
2199
2199
|
).catch((err: any) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -2305,7 +2305,7 @@ export async function verifyEmailOtpLogin(
|
|
|
2305
2305
|
email: session.email,
|
|
2306
2306
|
code: cleanCode,
|
|
2307
2307
|
requestId,
|
|
2308
|
-
version: getQwenWebVersion() || "0.3.
|
|
2308
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2309
2309
|
timezone: formatAsciiTimezone(),
|
|
2310
2310
|
},
|
|
2311
2311
|
).catch((err: any) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -2363,7 +2363,7 @@ export async function verifyEmailOtpLogin(
|
|
|
2363
2363
|
cookie: `token=${accessToken}`,
|
|
2364
2364
|
userAgent: session.fingerprint.userAgent,
|
|
2365
2365
|
bxV: "2.5.37",
|
|
2366
|
-
version: getQwenWebVersion() || "0.3.
|
|
2366
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2367
2367
|
userId: userId || undefined,
|
|
2368
2368
|
tokenExpiresAt: exp || undefined,
|
|
2369
2369
|
refreshToken: refreshToken || undefined,
|
|
@@ -2670,7 +2670,7 @@ async function loginViaApi(
|
|
|
2670
2670
|
accept: "application/json, text/plain, */*",
|
|
2671
2671
|
"content-type": "application/json",
|
|
2672
2672
|
source: "web",
|
|
2673
|
-
version: "0.3.
|
|
2673
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2674
2674
|
"x-request-origin": "https://chat.qwen.ai",
|
|
2675
2675
|
timezone: tz,
|
|
2676
2676
|
"x-request-id": requestId,
|
|
@@ -2711,7 +2711,7 @@ async function loginViaApi(
|
|
|
2711
2711
|
accept: "application/json, text/plain, */*",
|
|
2712
2712
|
"content-type": "application/json",
|
|
2713
2713
|
source: "web",
|
|
2714
|
-
version: "0.3.
|
|
2714
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2715
2715
|
timezone: tz,
|
|
2716
2716
|
"x-request-id": requestId,
|
|
2717
2717
|
},
|
|
@@ -3153,7 +3153,7 @@ export async function refreshAccountToken(
|
|
|
3153
3153
|
headers: {
|
|
3154
3154
|
accept: "application/json, text/plain, */*",
|
|
3155
3155
|
source: "web",
|
|
3156
|
-
version: "0.3.
|
|
3156
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
3157
3157
|
"x-request-origin": "https://chat.qwen.ai",
|
|
3158
3158
|
timezone: tz,
|
|
3159
3159
|
authorization: `Bearer ${rTok}`,
|
package/src/services/qwen.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
UpstreamRateLimit,
|
|
11
11
|
ClientAbortedError,
|
|
12
12
|
} from "../core/errors.ts";
|
|
13
|
-
import { buildQwenRequestHeaders } from "./qwen-headers.ts";
|
|
13
|
+
import { buildQwenRequestHeaders, getQwenWebVersion } from "./qwen-headers.ts";
|
|
14
14
|
import { qwenOrigin, qwenUrl } from "./qwen-url.ts";
|
|
15
15
|
import { config, type ChatMode, isLocalChatMode } from "../core/config.ts";
|
|
16
16
|
import { logger } from "../core/logger.ts";
|
|
@@ -2369,7 +2369,7 @@ export async function deleteSingleQwenChat(
|
|
|
2369
2369
|
|
|
2370
2370
|
const requestHeaders: Record<string, string> = {
|
|
2371
2371
|
source: "web",
|
|
2372
|
-
version: "0.
|
|
2372
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2373
2373
|
timezone: formatAsciiTimezone(),
|
|
2374
2374
|
"x-request-id": crypto.randomUUID(),
|
|
2375
2375
|
Referer: qwenUrl(`/c/${encodeURIComponent(chatId)}`),
|
|
@@ -2422,7 +2422,7 @@ export async function fetchRemoteQwenChats(
|
|
|
2422
2422
|
}
|
|
2423
2423
|
|
|
2424
2424
|
const requestHeaders: Record<string, string> = {
|
|
2425
|
-
version: "0.
|
|
2425
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2426
2426
|
timezone: formatAsciiTimezone(),
|
|
2427
2427
|
"x-request-id": crypto.randomUUID(),
|
|
2428
2428
|
Referer: qwenUrl("/settings/chats"),
|