-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconst.ts
61 lines (57 loc) · 1.35 KB
/
const.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
const EmptyObj = {};
export type EmptyObj = typeof EmptyObj;
export const GOOGLE_OPEN_ID_SCOPE = "openid";
export const GOOGLE_GDRIVE_SCOPES = [
"https://www.googleapis.com/auth/drive.file",
];
export const GOOGLE_EMAIL_SCOPE = "email";
export const GOOGLE_OFFLINE_CONSENT_PARAMS = {
access_type: "offline",
prompt: "consent",
};
export const AUTH_COOKIE_NAME = "auth";
export type GoogleAuthJwtPayload = {
iss: string;
azp: string;
aud: string;
sub: string;
email: string;
email_verified: boolean;
at_hash: string;
name: string;
picture: string;
given_name: string;
family_name: string;
iat: number;
exp: number;
};
export type AppCtx<T extends object = Record<string, unknown>> = {
Variables: EmptyObj & T;
};
export type Bucket = {
__typename: "Bucket";
user_id: string;
email: string;
access_token: string;
refresh_token: string;
};
export type User = {
__typename: "User";
id: string;
buckets: Map<string, Bucket>;
};
export type Session =
& {
__typename: "Session";
id: string;
email?: string | undefined | never;
user_id?: string | undefined | never;
}
& ({
_tag: "Session::unknown";
email?: string | undefined;
} | {
_tag: "Session::normal";
user_id: string;
email: string;
});