11import { join } from "path" ;
22import { readdir , readJson , readFile } from "fs-extra" ;
3- import { RequestHandler , rest } from "msw" ;
3+ import { http , RequestHandler } from "msw" ;
44import {
55 GitHubApiRequest ,
66 isAutoModelRequest ,
@@ -94,7 +94,7 @@ function createGetRepoRequestHandler(
9494
9595 const getRepoRequest = getRepoRequests [ 0 ] ;
9696
97- return rest . get ( `${ baseUrl } /repos/:owner/:name` , ( ) => {
97+ return http . get ( `${ baseUrl } /repos/:owner/:name` , ( ) => {
9898 return jsonResponse ( getRepoRequest . response . body , {
9999 status : getRepoRequest . response . status ,
100100 } ) ;
@@ -114,7 +114,7 @@ function createSubmitVariantAnalysisRequestHandler(
114114
115115 const getRepoRequest = submitVariantAnalysisRequests [ 0 ] ;
116116
117- return rest . post (
117+ return http . post (
118118 `${ baseUrl } /repositories/:controllerRepoId/code-scanning/codeql/variant-analyses` ,
119119 ( ) => {
120120 return jsonResponse ( getRepoRequest . response . body , {
@@ -135,7 +135,7 @@ function createGetVariantAnalysisRequestHandler(
135135 // During the lifetime of a variant analysis run, there are multiple requests
136136 // to get the variant analysis. We need to return different responses for each
137137 // request, so keep an index of the request and return the appropriate response.
138- return rest . get (
138+ return http . get (
139139 `${ baseUrl } /repositories/:controllerRepoId/code-scanning/codeql/variant-analyses/:variantAnalysisId` ,
140140 ( ) => {
141141 const request = getVariantAnalysisRequests [ requestIndex ] ;
@@ -159,7 +159,7 @@ function createGetVariantAnalysisRepoRequestHandler(
159159 isGetVariantAnalysisRepoRequest ,
160160 ) ;
161161
162- return rest . get (
162+ return http . get (
163163 `${ baseUrl } /repositories/:controllerRepoId/code-scanning/codeql/variant-analyses/:variantAnalysisId/repositories/:repoId` ,
164164 ( { request, params } ) => {
165165 const scenarioRequest = getVariantAnalysisRepoRequests . find (
@@ -183,7 +183,7 @@ function createGetVariantAnalysisRepoResultRequestHandler(
183183 isGetVariantAnalysisRepoResultRequest ,
184184 ) ;
185185
186- return rest . get (
186+ return http . get (
187187 "https://objects-origin.githubusercontent.com/codeql-query-console/codeql-variant-analysis-repo-tasks/:variantAnalysisId/:repoId/*" ,
188188 ( { request, params } ) => {
189189 const scenarioRequest = getVariantAnalysisRepoResultRequests . find (
@@ -216,7 +216,7 @@ function createCodeSearchRequestHandler(
216216 // During a code search, there are multiple request to get pages of results. We
217217 // need to return different responses for each request, so keep an index of the
218218 // request and return the appropriate response.
219- return rest . get ( `${ baseUrl } /search/code` , ( ) => {
219+ return http . get ( `${ baseUrl } /search/code` , ( ) => {
220220 const request = codeSearchRequests [ requestIndex ] ;
221221
222222 if ( requestIndex < codeSearchRequests . length - 1 ) {
@@ -239,7 +239,7 @@ function createAutoModelRequestHandler(
239239 // During automodeling there can be multiple API requests for each batch
240240 // of candidates we want to model. We need to return different responses for each request,
241241 // so keep an index of the request and return the appropriate response.
242- return rest . post (
242+ return http . post (
243243 `${ baseUrl } /repos/github/codeql/code-scanning/codeql/auto-model` ,
244244 ( ) => {
245245 const request = autoModelRequests [ requestIndex ] ;
0 commit comments