@@ -7,7 +7,7 @@ import { NpmRegistryService, NpmRegistryConfigEntry, NpmRegistryConfig } from ".
77
88type RequestConfig = {
99 workspaceId : string ;
10- npmRegistryConfig : NpmRegistryConfig ;
10+ npmRegistries : NpmRegistryConfig ;
1111}
1212
1313type InnerRequestConfig = {
@@ -92,15 +92,15 @@ export async function fetchRegistryWithConfig(request: ServerRequest, response:
9292 return response . status ( 400 ) . send ( "Missing workspaceId and/or npmRegistryConfig" ) ;
9393 }
9494
95- const { npmRegistryConfig} : RequestConfig = request . body ;
95+ const { npmRegistries : npmRegistryConfig } : RequestConfig = request . body ;
9696
9797 const registry = NpmRegistryService . getRegistryEntryForPackageWithConfig ( pathPackageInfo . packageId , npmRegistryConfig ) ;
9898
9999 const registryResponse = await fetchFromRegistry ( path , registry ) ;
100100 if ( ! registryResponse . ok ) {
101101 return response . status ( registryResponse . status ) . send ( await registryResponse . text ( ) ) ;
102102 }
103- response . json ( await registryResponse . json ( ) ) ;
103+ response . send ( await registryResponse . text ( ) ) ;
104104 } catch ( error ) {
105105 logger . error ( "Error fetching registry" , error ) ;
106106 response . status ( 500 ) . send ( "Internal server error" ) ;
@@ -149,7 +149,7 @@ export async function fetchPackageFileWithConfig(request: ServerRequest, respons
149149 return response . status ( 400 ) . send ( "Missing workspaceId and/or npmRegistryConfig" ) ;
150150 }
151151
152- const { workspaceId, npmRegistryConfig} : RequestConfig = request . body ;
152+ const { workspaceId, npmRegistries : npmRegistryConfig } : RequestConfig = request . body ;
153153 const registryConfig : NpmRegistryConfig = npmRegistryConfig ;
154154 const registry = NpmRegistryService . getRegistryEntryForPackageWithConfig ( pathPackageInfo . packageId , registryConfig ) ;
155155
@@ -246,7 +246,7 @@ async function fetchPackageFileInner(request: ServerRequest, response: ServerRes
246246
247247function parsePackageInfoFromPath ( path : string ) : { packageId : string , organization : string , name : string , version : string , file : string } | undefined {
248248 //@ts -ignore - regex groups
249- const packageInfoRegex = / ^ \/ ? (?< packageId > (?: @ (?< organization > [ a - z 0 - 9 - ~ ] [ a - z 0 - 9 - ._ ~ ] * ) \/ ) ? (?< name > [ a - z 0 - 9 - ~ ] [ a - z 0 - 9 - ._ ~ ] * ) ) (?: @ (?< version > [ - a - z 0 - 9 > < = _ . ^ ~ ] + ) ) ? \/ (?< file > [ ^ \r \n ] * ) ? $ / ;
249+ const packageInfoRegex = / ^ \/ ? (?< packageId > (?: @ (?< organization > [ a - z 0 - 9 - ~ ] [ a - z 0 - 9 - ._ ~ ] * ) \/ ) ? (?< name > [ a - z 0 - 9 - ~ ] [ a - z 0 - 9 - ._ ~ ] * ) ) (?: @ (?< version > [ - a - z 0 - 9 > < = _ . ^ ~ ] + ) ) ? ( \/ (?< file > [ ^ \r \n ] * ) ) ? $ / ;
250250 const matches = path . match ( packageInfoRegex ) ;
251251 if ( ! matches ?. groups ) {
252252 return ;
0 commit comments