@@ -27,6 +27,7 @@ export const create = {
2727
2828 if ( input ) {
2929 const {
30+ config,
3031 cwd,
3132 debugLog,
3233 dryRun,
@@ -38,7 +39,7 @@ export const create = {
3839 view,
3940 } = input
4041
41- const result = input && await createReport ( packagePaths , { cwd, debugLog, dryRun } )
42+ const result = input && await createReport ( packagePaths , { config , cwd, debugLog, dryRun } )
4243
4344 if ( result && view ) {
4445 const reportId = result . data . id
@@ -58,6 +59,7 @@ export const create = {
5859
5960/**
6061 * @typedef CommandContext
62+ * @property {import('@socketsecurity/config').SocketYml|undefined } config
6163 * @property {string } cwd
6264 * @property {typeof console.error } debugLog
6365 * @property {boolean } dryRun
@@ -191,6 +193,7 @@ async function setupCommand (name, description, argv, importMeta) {
191193 const packagePaths = await getPackageFiles ( cwd , cli . input , config , debugLog )
192194
193195 return {
196+ config,
194197 cwd,
195198 debugLog,
196199 dryRun,
@@ -205,10 +208,10 @@ async function setupCommand (name, description, argv, importMeta) {
205208
206209/**
207210 * @param {string[] } packagePaths
208- * @param {Pick<CommandContext, 'cwd' | 'debugLog' | 'dryRun'> } context
211+ * @param {Pick<CommandContext, 'config' | ' cwd' | 'debugLog' | 'dryRun'> } context
209212 * @returns {Promise<void|import('@socketsecurity/sdk').SocketSdkReturnType<'createReport'>> }
210213 */
211- async function createReport ( packagePaths , { cwd, debugLog, dryRun } ) {
214+ async function createReport ( packagePaths , { config , cwd, debugLog, dryRun } ) {
212215 debugLog ( 'Uploading:' , packagePaths . join ( `\n${ logSymbols . info } Uploading: ` ) )
213216
214217 if ( dryRun ) {
@@ -217,7 +220,8 @@ async function createReport (packagePaths, { cwd, debugLog, dryRun }) {
217220
218221 const socketSdk = await setupSdk ( )
219222 const spinner = ora ( `Creating report with ${ packagePaths . length } package files` ) . start ( )
220- const result = await handleApiCall ( socketSdk . createReportFromFilePaths ( packagePaths , cwd ) , spinner , 'creating report' )
223+ const apiCall = socketSdk . createReportFromFilePaths ( packagePaths , cwd , config ?. issueRules )
224+ const result = await handleApiCall ( apiCall , spinner , 'creating report' )
221225
222226 if ( result . success === false ) {
223227 return handleUnsuccessfulApiResponse ( result , spinner )
0 commit comments