This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconstants.ts
80 lines (77 loc) · 1.88 KB
/
constants.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import {
RelationshipClass,
StepEntityMetadata,
StepRelationshipMetadata,
} from '@jupiterone/integration-sdk-core';
export const Steps = {
ACCOUNT: 'fetch-account',
USERS: 'fetch-users',
GROUPS: 'fetch-groups',
GROUP_USER_RELATIONSHIPS: 'build-user-group-relationships',
};
export const Entities: Record<
'ACCOUNT' | 'GROUP' | 'USER',
StepEntityMetadata
> = {
ACCOUNT: {
resourceName: 'Account',
_type: 'acme_account',
_class: ['Account'],
schema: {
properties: {
mfaEnabled: { type: 'boolean' },
manager: { type: 'string' },
},
required: ['mfaEnabled', 'manager'],
},
},
GROUP: {
resourceName: 'UserGroup',
_type: 'acme_group',
_class: ['UserGroup'],
schema: {
properties: {
email: { type: 'string' },
logoLink: { type: 'string' },
},
required: ['email', 'logoLink'],
},
},
USER: {
resourceName: 'User',
_type: 'acme_user',
_class: ['User'],
schema: {
properties: {
username: { type: 'string' },
email: { type: 'string' },
active: { type: 'boolean' },
firstName: { type: 'string' },
},
required: ['username', 'email', 'active', 'firstName'],
},
},
};
export const Relationships: Record<
'ACCOUNT_HAS_USER' | 'ACCOUNT_HAS_GROUP' | 'GROUP_HAS_USER',
StepRelationshipMetadata
> = {
ACCOUNT_HAS_USER: {
_type: 'acme_account_has_user',
sourceType: Entities.ACCOUNT._type,
_class: RelationshipClass.HAS,
targetType: Entities.USER._type,
},
ACCOUNT_HAS_GROUP: {
_type: 'acme_account_has_group',
sourceType: Entities.ACCOUNT._type,
_class: RelationshipClass.HAS,
targetType: Entities.GROUP._type,
},
GROUP_HAS_USER: {
_type: 'acme_group_has_user',
sourceType: Entities.GROUP._type,
_class: RelationshipClass.HAS,
targetType: Entities.USER._type,
},
};