@@ -87,8 +87,8 @@ export async function getSupportedVersions() {
8787 return supportedVersions ;
8888}
8989
90- export async function getSummary ( reportId , req ) {
91- const { data } = await req . getReport ( reportId ) ;
90+ export function getSummary ( report ) {
91+ const { data } = report ;
9292 const summaryList = data ?. relationships ?. summaries ?. data ;
9393 if ( ! summaryList ?. length ) return ;
9494 const summaries = summaryList . filter ( ( summary ) => summary ?. attributes ?. category === 'team' ) ;
@@ -139,17 +139,25 @@ export async function createIssue(title, content, repository, { cli, req }) {
139139 }
140140}
141141
142- export async function pickReport ( report , { cli , req } ) {
142+ export function getReportSeverity ( report ) {
143143 const {
144- id, attributes : { title, cve_ids } ,
145- relationships : { severity, weakness, reporter, custom_field_values }
144+ relationships : { severity, weakness }
146145 } = report ;
147- const link = `https://hackerone.com/reports/${ id } ` ;
148146 const reportSeverity = {
149147 rating : severity ?. data ?. attributes ?. rating || '' ,
150148 cvss_vector_string : severity ?. data ?. attributes ?. cvss_vector_string || '' ,
151149 weakness_id : weakness ?. data ?. id || ''
152150 } ;
151+ return reportSeverity ;
152+ }
153+
154+ export async function pickReport ( report , { cli, req } ) {
155+ const {
156+ id, attributes : { title, cve_ids } ,
157+ relationships : { reporter, custom_field_values }
158+ } = report ;
159+ const link = `https://hackerone.com/reports/${ id } ` ;
160+ const reportSeverity = getReportSeverity ( report ) ;
153161
154162 cli . separator ( ) ;
155163 cli . info ( `Report: ${ link } - ${ title } (${ reportSeverity ?. rating } )` ) ;
@@ -185,7 +193,7 @@ export async function pickReport(report, { cli, req }) {
185193 }
186194 }
187195
188- const summaryContent = await getSummary ( id , req ) ;
196+ const summaryContent = getSummary ( report ) ;
189197
190198 return {
191199 id,
0 commit comments