feat: add launcher protocol data archive

- Add protocol data for multiple locales and versions
- Implement protocol archiving in archive command
- Update Api types and default settings for protocol support
This commit is contained in:
daydreamer-json
2026-03-12 16:14:29 +09:00
parent 6d0f2e3894
commit b1ed9573e5
62 changed files with 1045 additions and 1 deletions

View File

@@ -24,4 +24,5 @@ export default {
'zh-cn',
'zh-tw',
] as const,
launcherWebLangCN: ['zh-cn'] as const,
};

View File

@@ -7,6 +7,39 @@ import defaultSettings from './defaultSettings.js';
import launcherWeb from './launcherWeb.js';
export default {
protocol: async (
appCode: string,
channel: number,
subChannel: number,
language: (typeof defaultSettings.launcherWebLang)[number],
region: 'os' | 'cn',
dataVersion: string = '',
): Promise<TypesApiAkEndfield.LauncherProtocol> => {
const apiBase =
region === 'cn'
? appConfig.network.api.akEndfield.base.launcherCN
: appConfig.network.api.akEndfield.base.launcher;
const rsp = await ky
.post(`https://${apiBase}/proxy/batch_proxy`, {
...defaultSettings.ky,
json: {
proxy_reqs: [
{
kind: 'get_protocol',
get_protocol_req: {
appcode: appCode,
channel: String(channel),
sub_channel: String(subChannel),
language,
dataVersion,
},
},
],
},
})
.json();
return (rsp as any).proxy_rsps[0].get_protocol as TypesApiAkEndfield.LauncherProtocol;
},
latestGame: async (
appCode: string,
launcherAppCode: string,