Files
kaoyan/frontend/src/types.ts
T

146 lines
3.1 KiB
TypeScript

export type Row = {
id: number;
year: number;
school_name: string;
school_code: string;
province: string;
level: string;
major_code: string;
major_name: string;
department_name: string;
department_code: string;
direction: string;
subjects: string[];
quota: number | null;
quota_text: string;
quota_scope: string;
degree_type: string;
study_mode: string;
exam_type: string;
advisor: string;
special_plans: string[];
remarks: string;
source: string;
source_url: string;
fetched_at: string;
year_verified: boolean;
favorite: boolean;
score_total: number | null;
score_year: number | null;
score_scope: string | null;
reference_books?: string[];
};
export type Score = {
year: number;
total: number | null;
scope: string;
raw_code?: string;
department_name?: string;
source?: string;
note?: string;
politics?: number | null;
english?: number | null;
special_one?: number | null;
special_two?: number | null;
};
export type History = { record: Row; scores: Score[]; plans: Row[] };
export type Job = {
id: string;
params: {
mode: string;
year: number;
major_code?: string;
provinces: string[];
};
status: string;
message: string;
created_at: string;
updated_at: string;
records: number;
errors: number;
completed_units: number;
};
export type Log = {
id: number;
created_at: string;
level: string;
message: string;
};
export type Province = { code: string; name: string };
export type Major = {
code: string;
name: string;
degree_type: string;
category: string;
discipline: string;
};
export type Overview = {
records: number;
schools: number;
majors: number;
favorites: number;
indexed_schools: number;
scores: number;
years: number[];
provinces: { province: string; count: number }[];
provinces_list: Province[];
sources: { name: string; role: string; url: string }[];
};
export type Config = {
network_mode: string;
pool_url: string;
pool_project: string;
backup_proxies: string[];
request_interval: number;
timeout: number;
retries: number;
};
export type Proxy = {
mode: string;
route: string;
active_proxy: string | null;
fallback: boolean;
counts: { count?: number; http_type?: { https: number; http: number } };
available: number;
quarantined: number;
error: string;
proxies: { url: string; failed: boolean; active: boolean }[];
};
export type PoolServiceStatus = {
api_ready: boolean;
items: {
name: string;
label: string;
pid: number | null;
state:
| "running"
| "restricted"
| "stopped"
| "external"
| "unknown"
| "invalid"
| "conflict";
verified: boolean;
elevated: boolean;
detail: string;
}[];
can_stop: boolean;
warning: string;
admin_command: string;
};
export type PoolManageResult = {
ok: boolean;
output: string;
message: string;
changed: boolean;
status: PoolServiceStatus;
};
export type Auth = {
saved: boolean;
valid: boolean;
message: string;
browser_state: string;
browser_message: string;
};
export type Filters = Record<string, string | number | boolean>;