-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
global.d.ts
160 lines (147 loc) · 2.95 KB
/
global.d.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
type Raw = import("knex").Knex.Raw;
type Match<T> = {
[K in keyof T]?: T[K] | [">" | ">=" | "<=" | "<", T[K]];
};
interface User {
apikey?: string;
banned_by_id?: number;
banned: boolean;
change_email_address?: string;
change_email_expires?: string;
change_email_token?: string;
cooldowns?: string[];
created_at: string;
email: string;
id: number;
password: string;
reset_password_expires?: string;
reset_password_token?: string;
updated_at: string;
verification_expires?: string;
verification_token?: string;
verified?: boolean;
}
interface UserJoined extends User {
admin?: boolean;
homepage?: string;
domain?: string;
domain_id?: number;
}
interface Domain {
id: number;
uuid: string;
address: string;
banned: boolean;
banned_by_id?: number;
created_at: string;
homepage?: string;
updated_at: string;
user_id?: number;
}
interface DomainSanitized {
id: string;
uuid: undefined;
address: string;
banned: boolean;
banned_by_id?: undefined;
created_at: string;
homepage?: string;
updated_at: string;
user_id?: undefined;
}
interface Host {
id: number;
address: string;
banned: boolean;
banned_by_id?: number;
created_at: string;
updated_at: string;
}
interface IP {
id: number;
created_at: string;
updated_at: string;
ip: string;
}
interface Link {
address: string;
banned_by_id?: number;
banned: boolean;
created_at: string;
description?: string;
domain_id?: number;
expire_in: string;
id: number;
password?: string;
target: string;
updated_at: string;
user_id?: number;
uuid: string;
visit_count: number;
}
interface LinkSanitized {
address: string;
banned_by_id?: undefined;
banned: boolean;
created_at: string;
domain_id?: undefined;
id: string;
link: string;
password: boolean;
target: string;
updated_at: string;
user_id?: undefined;
uuid?: undefined;
visit_count: number;
}
interface LinkJoinedDomain extends Link {
domain?: string;
}
interface Visit {
id: number;
countries: Record<string, number>;
created_at: string;
link_id: number;
referrers: Record<string, number>;
total: number;
br_chrome: number;
br_edge: number;
br_firefox: number;
br_ie: number;
br_opera: number;
br_other: number;
br_safari: number;
os_android: number;
os_ios: number;
os_linux: number;
os_macos: number;
os_other: number;
os_windows: number;
}
interface Stats {
browser: Record<
"chrome" | "edge" | "firefox" | "ie" | "opera" | "other" | "safari",
number
>;
os: Record<
"android" | "ios" | "linux" | "macos" | "other" | "windows",
number
>;
country: Record<string, number>;
referrer: Record<string, number>;
}
declare namespace Express {
export interface Request {
realIP?: string;
pageType?: string;
linkTarget?: string;
protectedLink?: string;
token?: string;
user: UserJoined;
context?: {
limit: number;
skip: number;
all: boolean;
};
}
}