♻️ UIAF重构,支持祈愿备份/恢复

close #109
This commit is contained in:
目棃
2024-05-07 19:52:34 +08:00
parent 2803d06418
commit 2f14405cab
14 changed files with 468 additions and 235 deletions

View File

@@ -6,7 +6,6 @@
import type { SchemaType } from "ajv/lib/types/index.js";
// 应用数据
import achievements from "./app/achievements.json";
import achievementSeries from "./app/achievementSeries.json";
import calendar from "./app/calendar.json";
@@ -14,17 +13,17 @@ import character from "./app/character.json";
import gacha from "./app/gacha.json";
import GCG from "./app/GCG.json";
import nameCards from "./app/namecard.json";
import uigfSchema from "./app/uigf-schema.json";
import weapon from "./app/weapon.json";
// 存档数据
import arcBirCalendar from "./archive/birth_calendar.json";
import arcBirDraw from "./archive/birth_draw.json";
import arcBirRole from "./archive/birth_role.json";
// Wiki 数据
import schemaUiaf from "./schema/uiaf-schema.json";
import schemaUigf from "./schema/uigf-schema.json";
import wikiCharacter from "./WIKI/character.json";
import wikiMaterial from "./WIKI/material.json";
import wikiWeapon from "./WIKI/weapon.json";
// App
export const AppAchievementsData: TGApp.App.Achievement.Item[] = achievements;
export const AppAchievementSeriesData: TGApp.App.Achievement.Series[] = achievementSeries;
export const AppCalendarData: TGApp.App.Calendar.Item[] = calendar;
@@ -33,10 +32,14 @@ export const AppGachaData: TGApp.App.Gacha.PoolItem[] = gacha;
export const AppGCGData: TGApp.App.GCG.WikiBriefInfo[] = GCG;
export const AppNameCardsData: TGApp.App.NameCard.Item[] = nameCards;
export const AppWeaponData: TGApp.App.Weapon.WikiBriefInfo[] = weapon;
export const AppUigfSchema: SchemaType = uigfSchema;
// Schema
export const UiafSchema: SchemaType = schemaUiaf;
export const UigfSchema: SchemaType = schemaUigf;
// Archive
export const ArcBirCalendar: TGApp.Archive.Birth.CalendarData = arcBirCalendar;
export const ArcBirDraw: TGApp.Archive.Birth.DrawItem[] = arcBirDraw;
export const ArcBirRole: TGApp.Archive.Birth.RoleItem[] = arcBirRole;
// Wiki
export const WikiCharacterData: TGApp.App.Character.WikiItem[] = wikiCharacter;
export const WikiWeaponData: TGApp.App.Weapon.WikiItem[] = wikiWeapon;
export const WikiMaterialData: TGApp.App.Material.WikiItem[] = wikiMaterial;

View File

@@ -0,0 +1,59 @@
{
"type": "object",
"properties": {
"info": {
"type": "object",
"properties": {
"export_app": {
"type": "string",
"description": "Export application name"
},
"export_app_version": {
"type": "string",
"description": "Export application version"
},
"uiaf_version": {
"type": "string",
"description": "UIAF version applied; Used to prevent application not working when UIGF have breaking update",
"pattern": "v\\d+.\\d+"
},
"export_timestamp": {
"type": "number",
"description": "Export time in UNIX timestamp"
}
},
"required": ["export_app", "uiaf_version"],
"description": "Include basic information defined by export application"
},
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "Achievement ID"
},
"current": {
"type": "number",
"description": "Process"
},
"status": {
"type": "number",
"description": "Finished status",
"enum": [0, 1, 2, 3],
"enumDesc": "ACHIEVEMENT_INVALID = 0; ACHIEVEMENT_UNFINISHED = 1; ACHIEVEMENT_FINISHED = 2;ACHIEVEMENT_POINT_TAKEN = 3;"
},
"timestamp": {
"type": "number",
"description": "Finished time"
}
},
"required": ["id", "current", "status", "timestamp"],
"description": "To represent an achievement"
},
"description": "Include finished or unfinished achievements"
}
},
"required": ["info", "list"]
}