feat: add epic games package archiving support

This commit is contained in:
daydreamer-json
2026-01-28 12:56:25 +09:00
parent 0c946fb998
commit ae62ae696e
20 changed files with 1442 additions and 662 deletions

40
src/utils/api/webview.ts Normal file
View File

@@ -0,0 +1,40 @@
import ky from 'ky';
import * as TypesApiAkEndfield from '../../types/api/akEndfield/Api.js';
import appConfig from '../config.js';
import defaultSettings from './defaultSettings.js';
export default {
record: {
char: async (
token: string,
serverId: number, // 2 or 3
poolType:
| 'E_CharacterGachaPoolType_Beginner'
| 'E_CharacterGachaPoolType_Standard'
| 'E_CharacterGachaPoolType_Special',
seqId: string | null,
lang: (typeof defaultSettings.launcherWebLang)[number] = 'ja-jp',
): Promise<TypesApiAkEndfield.WebViewRecordChar> => {
const rsp = await ky
.get(`https://${appConfig.network.api.akEndfield.base.webview}/api/record/char`, {
...defaultSettings.ky,
searchParams: { lang, seq_id: seqId ?? undefined, pool_type: poolType, token, server_id: serverId },
})
.json();
return rsp as TypesApiAkEndfield.WebViewRecordChar;
},
},
content: async (
serverId: number, // 2 or 3
poolId: string,
lang: (typeof defaultSettings.launcherWebLang)[number] = 'ja-jp',
): Promise<TypesApiAkEndfield.WebViewRecordContent> => {
const rsp = await ky
.get(`https://${appConfig.network.api.akEndfield.base.webview}/api/content`, {
...defaultSettings.ky,
searchParams: { lang, pool_id: poolId, server_id: serverId },
})
.json();
return rsp as TypesApiAkEndfield.WebViewRecordContent;
},
};