-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAuditTrail.ts
55 lines (48 loc) · 1.35 KB
/
AuditTrail.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 { Model } from 'objection';
import { BaseModel } from './BaseModel';
import { ModelObjectOpt } from './ModelObjectOpt';
export enum AuditAction {
Add = 'Add',
Delete = 'Delete',
Update = 'Update',
}
export enum AuditTrailEvents {
UpdateSharingPermissions = 'UpdateSharingPermissions',
UpdateSharingTypes = 'UpdateSharingTypes',
ApproveAccount = 'ApproveAccount',
ManageKeyPair = 'ManageKeyPair',
ManageApiKey = 'ManageApiKey',
ManageParticipant = 'ManageParticipant',
UpdateDomainNames = 'UpdateDomainNames',
UpdateAppNames = 'UpdateAppNames',
ManageTeamMembers = 'ManageTeamMembers',
ChangeUserLock = 'ChangeUserLock',
}
export class AuditTrail extends BaseModel {
static get tableName() {
return 'auditTrails';
}
static readonly relationMappings = {
user: {
relation: Model.BelongsToOneRelation,
modelClass: 'User',
join: {
from: 'auditTrails.userId',
to: 'users.id',
},
},
};
static get jsonAttributes() {
return ['eventData'];
}
declare id: number;
declare userId: number;
declare userEmail: string;
declare succeeded: boolean;
declare event: AuditTrailEvents;
declare eventData: unknown;
declare participantId?: number | null;
// eslint-disable-next-line camelcase
declare updated_at: Date;
}
export type AuditTrailDTO = ModelObjectOpt<AuditTrail>;