@@ -190,6 +190,10 @@ export interface CodeQL {
190
190
) : Promise < void > ;
191
191
/** Get the location of an extractor for the specified language. */
192
192
resolveExtractor ( language : Language ) : Promise < string > ;
193
+ /**
194
+ * Run 'codeql resolve queries --format=startingpacks'.
195
+ */
196
+ resolveQueriesStartingPacks ( queries : string [ ] ) : Promise < string [ ] > ;
193
197
/**
194
198
* Run 'codeql github merge-results'.
195
199
*/
@@ -448,6 +452,10 @@ export function setCodeQL(partialCodeql: Partial<CodeQL>): CodeQL {
448
452
) ,
449
453
diagnosticsExport : resolveFunction ( partialCodeql , "diagnosticsExport" ) ,
450
454
resolveExtractor : resolveFunction ( partialCodeql , "resolveExtractor" ) ,
455
+ resolveQueriesStartingPacks : resolveFunction (
456
+ partialCodeql ,
457
+ "resolveQueriesStartingPacks" ,
458
+ ) ,
451
459
mergeResults : resolveFunction ( partialCodeql , "mergeResults" ) ,
452
460
} ;
453
461
return cachedCodeQL ;
@@ -944,6 +952,24 @@ export async function getCodeQLForCmd(
944
952
) . exec ( ) ;
945
953
return JSON . parse ( extractorPath ) as string ;
946
954
} ,
955
+ async resolveQueriesStartingPacks ( queries : string [ ] ) : Promise < string [ ] > {
956
+ const codeqlArgs = [
957
+ "resolve" ,
958
+ "queries" ,
959
+ "--format=startingpacks" ,
960
+ ...getExtraOptionsFromEnv ( [ "resolve" , "queries" ] ) ,
961
+ ...queries ,
962
+ ] ;
963
+ const output = await runCli ( cmd , codeqlArgs , { noStreamStdout : true } ) ;
964
+
965
+ try {
966
+ return JSON . parse ( output ) as string [ ] ;
967
+ } catch ( e ) {
968
+ throw new Error (
969
+ `Unexpected output from codeql resolve queries --format=startingpacks: ${ e } ` ,
970
+ ) ;
971
+ }
972
+ } ,
947
973
async mergeResults (
948
974
sarifFiles : string [ ] ,
949
975
outputFile : string ,
0 commit comments