-
Notifications
You must be signed in to change notification settings - Fork 167
/
rolesTypes.ts
52 lines (32 loc) · 955 Bytes
/
rolesTypes.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
import type { IfExistsOption, Name, Value } from './generalTypes';
export interface RoleOptions {
superuser?: boolean;
createdb?: boolean;
createrole?: boolean;
inherit?: boolean;
login?: boolean;
replication?: boolean;
bypassrls?: boolean;
limit?: number;
password?: Value;
encrypted?: boolean;
valid?: Value;
inRole?: string | string[];
role?: string | string[];
admin?: string | string[];
}
type CreateRoleFn = (
roleName: Name,
roleOptions?: RoleOptions & IfExistsOption
) => string | string[];
export type CreateRole = CreateRoleFn & { reverse: CreateRoleFn };
export type DropRole = (
roleName: Name,
options?: IfExistsOption
) => string | string[];
export type AlterRole = (
roleName: Name,
roleOptions: RoleOptions
) => string | string[];
type RenameRoleFn = (oldRoleName: Name, newRoleName: Name) => string | string[];
export type RenameRole = RenameRoleFn & { reverse: RenameRoleFn };