1
0
forked from boos/BoosAPI

feat: update error messages in NewApiAdapter tests to use correct Chinese translations

feat: enhance proxy usage parser to include cache read and creation tokens

feat: add billing details to ProxyLog interface and implement related formatting functions

fix: correct mojibake issues in source files and add regression test for mojibake detection

chore: add SQL migration for billing details in proxy_logs table

test: improve site speed button tests to ensure proper state updates without DOM lookups
This commit is contained in:
cita
2026-03-06 17:10:01 +08:00
parent 2a810facb8
commit 55b1ae564e
23 changed files with 1298 additions and 344 deletions
+6 -6
View File
@@ -210,7 +210,7 @@ describe('NewApiAdapter', () => {
if (req.url === '/api/user/self') {
if (typeof req.headers.authorization === 'string' && req.headers.authorization === `Bearer ${BALANCE_FAIL_TOKEN}`) {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ success: false, message: '閺冪姵娼堟潻娑滎攽濮濄倖鎼锋担婊愮礉閺堫亞娅ヨぐ鏇氱瑬閺堫亝褰佹笟?access token' }));
res.end(JSON.stringify({ success: false, message: '无权进行此操作,access token 无效' }));
return;
}
@@ -222,7 +222,7 @@ describe('NewApiAdapter', () => {
)
) {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ success: false, message: '閺冪姵娼堟潻娑滎攽濮濄倖鎼锋担婊愮礉閺堫亞娅ヨぐ鏇氱瑬閺堫亝褰佹笟?access token' }));
res.end(JSON.stringify({ success: false, message: '无权进行此操作,access token 无效' }));
return;
}
@@ -316,12 +316,12 @@ describe('NewApiAdapter', () => {
}
if (typeof req.headers.authorization === 'string' && req.headers.authorization === `Bearer ${CHECKIN_ALREADY_TOKEN}`) {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ success: false, message: '浠婂ぉ宸茬粡绛惧埌杩囧暒' }));
res.end(JSON.stringify({ success: false, message: '今天已经签到过啦' }));
return;
}
if (typeof req.headers.cookie === 'string' && req.headers.cookie.includes(`session=${CHECKIN_ALREADY_TOKEN}`)) {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ success: false, message: '鏃犳潈杩涜姝ゆ搷浣滐紝鏈櫥褰曚笖鏈彁渚?access token' }));
res.end(JSON.stringify({ success: false, message: '无权进行此操作,未登录且未提供 access token' }));
return;
}
if (typeof req.headers.authorization === 'string' && req.headers.authorization === `Bearer ${COOKIE_SHIELDED_TOKEN}`) {
@@ -349,7 +349,7 @@ describe('NewApiAdapter', () => {
if (req.url === '/api/user/sign_in') {
if (typeof req.headers.cookie === 'string' && req.headers.cookie.includes(`session=${CHECKIN_ALREADY_TOKEN}`)) {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ success: false, message: '鏃犳潈杩涜姝ゆ搷浣滐紝鏈櫥褰曚笖鏈彁渚?access token' }));
res.end(JSON.stringify({ success: false, message: '无权进行此操作,未登录且未提供 access token' }));
return;
}
}
@@ -510,7 +510,7 @@ describe('NewApiAdapter', () => {
const result = await adapter.checkin(baseUrl, CHECKIN_ALREADY_TOKEN, 11494);
expect(result.success).toBe(false);
expect(result.message).toBe('浠婂ぉ宸茬粡绛惧埌杩囧暒');
expect(result.message).toBe('今天已经签到过啦');
});
it('sends all compatibility user-id headers when userId is known', async () => {