-
Notifications
You must be signed in to change notification settings - Fork 2k
/
user.d.ts
45 lines (39 loc) · 884 Bytes
/
user.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
export type OAuthToken = {
readonly access_token: string;
readonly token_type: string;
readonly refresh_token: string;
readonly expiry: string;
};
export type UserInfo = {
readonly k8s_username: string;
readonly name: string;
readonly avatar: string;
readonly nsid: string;
readonly ns_uid: string;
readonly userId: string;
};
export type KubeConfig = string;
export type Session = {
token: string; // jwt token
// 提供一些简单的信息
user: UserInfo;
// 帮忙导出用的
kubeconfig: KubeConfig;
};
export type UserQuotaItemType = {
type: 'cpu' | 'memory' | 'storage' | 'gpu';
used: number;
limit: number;
};
export type UserInfoV1 = Readonly<{
id: string;
name: string;
avatar: string;
k8sUsername: string;
nsid: string;
}>;
export type SessionV1 = {
token?: OAuthToken;
user: UserInfoV1;
kubeconfig: KubeConfig;
};