@@ -15,6 +15,17 @@ const pocEmailColumnNumbers = Array.from(
1515 { length : 10 } ,
1616 ( _ , index ) => index + 1
1717)
18+ const partnerRoleTypeValues = new Set ( [
19+ '' ,
20+ 'Bug Bounty Provider' ,
21+ 'CERT' ,
22+ 'Consortium' ,
23+ 'Hosted Service' ,
24+ 'N/A' ,
25+ 'Open Source' ,
26+ 'Researcher' ,
27+ 'Vendor'
28+ ] )
1829
1930const countryNames = new Set ( countryList . map ( ( country ) => country . name ) )
2031const countryAliases = new Map ( [
@@ -101,7 +112,7 @@ function buildAsOrgRows (rawRows) {
101112 vulnerability_advisory_location_for_web_scraping : toOptionalSingleItemArray (
102113 row . vulnerability_advisory_location_s_for_web_scraping
103114 ) ,
104- partner_role_type : row . cna_role_type ,
115+ partner_role_type : formatPartnerRoleType ( row . cna_role_type ) ,
105116 partner_number : formatPartnerNumber ( row ) ,
106117 partner_country : normalizePartnerCountry ( row , unknownCountries ) ,
107118 primary_poc_name : formatPocName ( row . primary_poc_name ) ,
@@ -167,6 +178,15 @@ function formatPartnerNumber (mondayOrg) {
167178 return `${ normalizedOrgLevel } -${ year } -${ number } `
168179}
169180
181+ function formatPartnerRoleType ( value ) {
182+ const values = Array . isArray ( value ) ? value : String ( value || '' ) . split ( / [ , \n ; ] / )
183+ const validValues = values
184+ . map ( ( roleType ) => String ( roleType || '' ) . trim ( ) )
185+ . filter ( ( roleType ) => partnerRoleTypeValues . has ( roleType ) )
186+
187+ return validValues . length ? _ . uniq ( validValues ) : undefined
188+ }
189+
170190function normalizePartnerCountry ( mondayOrg , unknownCountries ) {
171191 const shortName = String ( mondayOrg . short_name || '' ) . trim ( )
172192 const country = String ( mondayOrg . cna_country || '' ) . trim ( )
0 commit comments