/
Api.ts
102 lines (89 loc) 路 2.07 KB
/
Api.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import * as apisauce from 'apisauce'
import { Options } from './Options'
export namespace Api {
export type site = keyof typeof SiteInitial
export interface Options
extends Partial<apisauce.ApisauceConfig>,
Options.Default {}
export enum SiteInitial {
en = 'en',
ru = 'ru',
ko = 'ko',
ja = 'ja',
fr = 'fr',
es = 'es',
th = 'th',
pl = 'pl',
de = 'de',
cn = 'cn',
it = 'it',
vn = 'vn',
int = 'int'
}
export enum SiteUrl {
en = 'http://scp-wiki.net',
ru = 'http://scpfoundation.ru',
ko = 'http://ko.scp-wiki.net',
ja = 'http://ja.scp-wiki.net',
fr = 'http://fondationscp.wikidot.com',
es = 'http://lafundacionscp.wikidot.com',
th = 'http://scp-th.wikidot.com',
pl = 'http://scp-wiki.net.pl',
de = 'http://scp-wiki-de.wikidot.com',
cn = 'http://scp-wiki-cn.wikidot.com',
it = 'http://fondazionescp.wikidot.com',
vn = 'http://scp-vn.wikidot.com',
int = 'http://scp-int.wikidot.com'
}
export type searchPage = {
pages: PageItem[]
}
export type searchUser = {
users: UserItem[]
}
export type searchTag = searchPage
export interface AuthorField {
user: string
role: string
id?: number
}
export interface PageItem {
id: number
site: string
name: string
title: string
altTitle: null | string
status: 'Translation' | 'Original'
kind: 'SCP' | 'Unknown'
creationDate: DateField
rating: number
cleanRating: number
contributorRating: number
adjustedRating: number
wilsonScore: number
rank: number
authors: AuthorField[]
deleted: boolean
}
export interface UserItem {
id: number
name: string
displayName: string
deleted: number
activity: Record<string, ActivityField>
}
export interface ActivityField {
votes: number
revisions: number
pages: number
lastActive?: DateField
member: DateField
highestRating?: number
totalRating?: number
}
export interface DateField {
date: string
timezone_type: number
timezone: string
}
}