forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaudit-log.js
More file actions
43 lines (42 loc) · 1.43 KB
/
Copy pathaudit-log.js
File metadata and controls
43 lines (42 loc) · 1.43 KB
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
import { GraphQLObjectType } from 'graphql'
import { globalIdField } from 'graphql-relay'
import { DomainRemovalReasonEnum } from '../../enums'
import { UserActionEnums } from '../../enums/user-action'
import { nodeInterface } from '../../node'
import { initiatedByType } from './initiated-by'
import { targetResourceType } from './target-resource'
import { GraphQLDateTime } from 'graphql-scalars'
export const auditLogType = new GraphQLObjectType({
name: 'AuditLog',
description:
'A record of activity that modified the state of a user, domain, or organization',
fields: () => ({
id: globalIdField('auditLog'),
timestamp: {
type: GraphQLDateTime,
description: 'Datetime string the activity occurred.',
resolve: ({ timestamp }) => timestamp,
},
initiatedBy: {
type: initiatedByType,
description: 'Username of admin that initiated the activity.',
resolve: ({ initiatedBy }) => initiatedBy,
},
action: {
type: UserActionEnums,
description: 'Type of activity that was initiated.',
resolve: ({ action }) => action,
},
target: {
type: targetResourceType,
description: 'Information on targeted resource.',
resolve: ({ target }) => target,
},
reason: {
type: DomainRemovalReasonEnum,
description: 'Optional reason for action, used for domain removal.',
resolve: ({ reason }) => reason,
},
}),
interfaces: [nodeInterface],
})