-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
55 lines (51 loc) · 1.12 KB
/
types.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
import type { User } from '@prisma/client'
// RouteMeta` w/ custom properties, like `requiredAuth`
declare module 'vue-router' {
interface RouteMeta extends RouteMeta {
requiredAuth?: boolean
}
}
// refs: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
export enum ApiMethod {
GET = 'GET',
PUT = 'PUT',
DELETE = 'DELETE',
POST = 'POST',
HEAD = 'HEAD',
CONNECT = 'CONNECT',
OPTIONS = 'OPTIONS',
TRACE = 'TRACE',
PATCH = 'PATCH',
CUSTOM = 'CUSTOM',
}
export enum ApiStatus {
DRAFT = 'DRAFT',
PUBLISHED = 'PUBLISHED',
}
export enum ProjectVisibility {
PUBLIC = 'PUBLIC',
PRIVATE = 'PRIVATE',
}
export enum Role {
Owner = 'Owner',
Maintainer = 'Maintainer',
Developer = 'Developer',
Viewer = 'Viewer',
}
export enum InviteStatus {
Pending = 'Pending',
Success = 'Success',
Reject = 'Reject',
}
export type SessionUser = Pick<User, 'id' | 'email' | 'username' | 'avatar'>
export interface Session {
user: SessionUser
}
export interface ApiParams {
key: string
type: 'string' | 'number'
example?: string
description?: string
required: boolean
scope: 'query' | 'path'
}