1
- using System ;
1
+ using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Linq ;
4
4
using System . Threading ;
@@ -192,10 +192,11 @@ public async Task<IPackageNameSearchResult> GetPackageNamesAsync(string prefix,
192
192
}
193
193
194
194
IReadOnlyList < string > results = new List < string > ( ) ;
195
- string frameworkQuery = ! string . IsNullOrEmpty ( queryConfiguration . CompatibiltyTarget ) ? $ "&supportedFramework={ queryConfiguration . CompatibiltyTarget } " : "" ;
196
- const string autoCompleteServiceTypeIdentifier = "SearchAutocompleteService" ;
195
+ string frameworkQuery = ! string . IsNullOrEmpty ( queryConfiguration . CompatibilityTarget ) ? $ "&supportedFramework={ queryConfiguration . CompatibilityTarget } " : "" ;
196
+ string packageTypeQuery = ! string . IsNullOrEmpty ( queryConfiguration . PackageType ? . Name ) ? $ "&packageType={ queryConfiguration . PackageType . Name } " : "" ;
197
+ const string autoCompleteServiceTypeIdentifier = "SearchAutocompleteService/3.5.0" ;
197
198
List < string > serviceEndpoints = await DiscoverEndpointsAsync ( _feed , autoCompleteServiceTypeIdentifier , cancellationToken ) . ConfigureAwait ( false ) ;
198
- Func < string , string > queryFunc = x => $ "{ x } ?q={ prefix } { frameworkQuery } &take={ queryConfiguration . MaxResults } &prerelease={ queryConfiguration . IncludePreRelease } ";
199
+ Func < string , string > queryFunc = x => $ "{ x } ?q={ prefix } &semVerLevel=2.0.0 { frameworkQuery } { packageTypeQuery } &take={ queryConfiguration . MaxResults } &prerelease={ queryConfiguration . IncludePreRelease } ";
199
200
JObject document = await ExecuteAutocompleteServiceQueryAsync ( serviceEndpoints , queryFunc , cancellationToken ) . ConfigureAwait ( false ) ;
200
201
201
202
if ( document != null )
@@ -294,7 +295,7 @@ public async Task<IPackageInfo> GetPackageInfoAsync(string packageId, string ver
294
295
licenseUrl = catalogEntry [ "licenseUrl" ] ? . ToString ( ) ;
295
296
iconUrl = catalogEntry [ "iconUrl" ] ? . ToString ( ) ;
296
297
tags = catalogEntry [ "tags" ] ? . ToString ( ) ;
297
- packageInfo = new PackageInfo ( id , version , title , authors , summary , description , licenseUrl , projectUrl , iconUrl , tags , _kind ) ;
298
+ packageInfo = new PackageInfo ( id , version , title , authors , summary , description , licenseUrl , projectUrl , iconUrl , tags , _kind , null ) ;
298
299
return packageInfo ;
299
300
}
300
301
}
@@ -311,7 +312,7 @@ public async Task<IPackageInfo> GetPackageInfoAsync(string packageId, string ver
311
312
licenseUrl = catalogEntry [ "licenseUrl" ] ? . ToString ( ) ;
312
313
iconUrl = catalogEntry [ "iconUrl" ] ? . ToString ( ) ;
313
314
tags = catalogEntry [ "tags" ] ? . ToString ( ) ;
314
- packageInfo = new PackageInfo ( id , version , title , authors , summary , description , licenseUrl , projectUrl , iconUrl , tags , _kind ) ;
315
+ packageInfo = new PackageInfo ( id , version , title , authors , summary , description , licenseUrl , projectUrl , iconUrl , tags , _kind , null ) ;
315
316
bestSemanticVersion = currentVersion ;
316
317
}
317
318
}
@@ -329,7 +330,7 @@ public async Task<IPackageInfo> GetPackageInfoAsync(string packageId, string ver
329
330
public async Task < IPackageVersionSearchResult > GetPackageVersionsAsync ( string id , IPackageQueryConfiguration queryConfiguration , CancellationToken cancellationToken )
330
331
{
331
332
IReadOnlyList < string > results = new List < string > ( ) ;
332
- string frameworkQuery = ! string . IsNullOrEmpty ( queryConfiguration . CompatibiltyTarget ) ? $ "&supportedFramework={ queryConfiguration . CompatibiltyTarget } " : "" ;
333
+ string frameworkQuery = ! string . IsNullOrEmpty ( queryConfiguration . CompatibilityTarget ) ? $ "&supportedFramework={ queryConfiguration . CompatibilityTarget } " : "" ;
333
334
const string autoCompleteServiceTypeIdentifier = "SearchAutocompleteService" ;
334
335
List < string > serviceEndpoints = await DiscoverEndpointsAsync ( _feed , autoCompleteServiceTypeIdentifier , cancellationToken ) . ConfigureAwait ( false ) ;
335
336
Func < string , string > queryFunc = x => $ "{ x } ?id={ id } { frameworkQuery } &take={ queryConfiguration . MaxResults } &prerelease={ queryConfiguration . IncludePreRelease } ";
0 commit comments