@@ -685,3 +685,44 @@ export enum RuntimeParamsHeadingType {
685685 KEY = 'key' ,
686686 VALUE = 'value' ,
687687}
688+
689+ export enum ACCESS_TYPE_MAP {
690+ DEVTRON_APPS = 'devtron-app' , // devtron app work flow
691+ HELM_APPS = 'helm-app' , // helm app work flow
692+ JOBS = '' , // Empty string is intentional since there is no bifurcation in jobs as of now
693+ }
694+
695+ export enum EntityTypes {
696+ CHART_GROUP = 'chart-group' ,
697+ DIRECT = 'apps' ,
698+ JOB = 'jobs' ,
699+ DOCKER = 'docker' ,
700+ GIT = 'git' ,
701+ CLUSTER = 'cluster' ,
702+ NOTIFICATION = 'notification' ,
703+ }
704+
705+ export interface CustomRoles {
706+ id : number
707+ roleName : string
708+ roleDisplayName : string
709+ roleDescription : string
710+ entity : EntityTypes
711+ accessType : ACCESS_TYPE_MAP . DEVTRON_APPS | ACCESS_TYPE_MAP . HELM_APPS
712+ }
713+
714+ export type MetaPossibleRoles = Record <
715+ CustomRoles [ 'roleName' ] ,
716+ {
717+ value : CustomRoles [ 'roleDisplayName' ]
718+ description : CustomRoles [ 'roleDescription' ]
719+ }
720+ >
721+
722+ export interface CustomRoleAndMeta {
723+ customRoles : CustomRoles [ ]
724+ possibleRolesMeta : MetaPossibleRoles
725+ possibleRolesMetaForHelm : MetaPossibleRoles
726+ possibleRolesMetaForCluster : MetaPossibleRoles
727+ possibleRolesMetaForJob : MetaPossibleRoles
728+ }
0 commit comments