-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.ts
122 lines (109 loc) · 2.55 KB
/
types.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
import { useAuth } from '~/store/auth';
const auth = useAuth();
declare global {
interface Window {
googleMapsLoadCallback: () => void,
}
type DirectusSchema = {
gp_adopted_probes: Probe[];
gp_credits: Credits[];
gp_credits_additions: CreditsAddition[];
gp_credits_deductions: CreditsDeduction[];
gp_tokens: Token[];
directus_users: User;
};
type Credits = {
amount: number;
user_id: string;
};
type CreditsAddition = {
amount: number;
comment: string;
date_created: 'datetime';
adopted_probe: number | null;
github_id: string;
};
type CreditsDeduction = {
amount: number;
date: 'datetime';
user_id: string;
};
type CreditsChange = {
type: 'addition' | 'deduction';
date_created: string;
comment?: string;
amount: number;
adopted_probe?: number | null;
};
type Probe = {
id: string;
asn: number;
city: string;
country: string;
countryOfCustomCity: string | null;
date_created: string;
date_updated: string;
ip: string;
altIps: string[];
isCustomCity: boolean;
lastSyncDate: string;
latitude: number;
longitude: number;
name: string | null;
network: string;
onlineTimesToday: number,
state: string | null,
status: 'initializing' | 'ready' | 'unbuffer-missing' | 'ping-test-failed' | 'sigterm';
tags: {
value: string;
prefix: string;
}[],
systemTags: string[],
userId: string;
uuid: string;
version: string;
hardwareDevice: string | null;
nodeVersion: string;
};
type User = typeof auth.getUser & {
id: string;
first_name: string | null;
last_name: string | null;
email: string | null;
external_identifier: string | null; // null for non-gh admin
github_organizations: string[];
github_username: string | null; // null for non-gh admin
user_type: 'member' | 'special' | 'sponsor';
appearance: null | 'light' | 'dark';
};
type Token = {
id: number;
date_created: string;
date_last_used: string | null;
date_updated: string | null;
expire: string | null;
name: string | null;
origins: string[];
value: string;
user_created: string;
user_updated: string | null;
};
type DashboardError = {
response?: {
statusText: string;
}
errors?: [{
message: string;
}];
message?: string;
};
type CodeApprovalDetails = {
client: {
name: string;
owner: {
name: string | null;
url: string | null;
}
};
} | null;
}