sdk
sdk copied to clipboard
Support `sourceType: string[]` in relationship metadata
Background
Relationships of a single _type
value can represent edges between two different source entity _type
s. For example, in the Okta integration, there are okta_user_group
and okta_app_user_group
entities that may both be related to an okta_application
, with the relationship _type
always being okta_group_assigned_application
. In this case, the metadata for the relationship has to be:
GROUP_ASSIGNED_APPLICATION: {
_type: 'okta_group_assigned_application',
_class: RelationshipClass.ASSIGNED,
sourceType: 'okta_user_group, okta_app_user_group',
targetType: Entities.APPLICATION._type,
}
We're unable to reference the constants for those entity types, and the documentation generate produces a single row.
Proposal
Add support to the metadata for sourceType: string[]
, and generate two rows in the documentation, one for each sourceType
.
GROUP_ASSIGNED_APPLICATION: {
_type: 'okta_group_assigned_application',
_class: RelationshipClass.ASSIGNED,
sourceType: [Entities.USER_GROUP, Entities.APP_USER_GROUP],
targetType: Entities.APPLICATION._type,
}