@@ -246,11 +246,13 @@ public async Task DownloadNupkgToFileAsync(
246246 /// </summary>
247247 /// <param name="packageSource">The package source that owns this client.</param>
248248 /// <param name="package">The package identifier to receive including the details.</param>
249+ /// <param name="includePrerelease">True to include prerelease packages (alpha, beta, etc).</param>
249250 /// <param name="cancellationToken">Token to cancel the HTTP request.</param>
250251 /// <returns>The package or null if we didn't find it.</returns>
251252 public async Task < NugetPackageV3 > GetPackageWithAllVersionsAsync (
252253 NugetPackageSourceV3 packageSource ,
253254 INugetPackageIdentifier package ,
255+ bool includePrerelease ,
254256 CancellationToken cancellationToken = default )
255257 {
256258 var registrationItems = await GetRegistrationPageItemsAsync ( packageSource , package , cancellationToken ) ;
@@ -262,13 +264,15 @@ public async Task<NugetPackageV3> GetPackageWithAllVersionsAsync(
262264 var versions = new List < NugetPackageVersion > ( ) ;
263265 RegistrationLeafObject latestVersionItem = null ;
264266 NugetPackageVersion latestVersion = null ;
267+ var sb = new StringBuilder ( ) ;
265268 foreach ( var item in registrationItems )
266269 {
267270 if ( item . items is null || item . items . Count == 0 )
268271 {
269272 item . items = await GetRegistrationPageLeafItems ( packageSource , item , cancellationToken ) . ConfigureAwait ( false ) ;
270273 }
271274
275+ var lastNote = string . Empty ;
272276 foreach ( var leafObject in item . items )
273277 {
274278 var catalogEntry = leafObject . CatalogEntry ;
@@ -280,19 +284,28 @@ public async Task<NugetPackageV3> GetPackageWithAllVersionsAsync(
280284 }
281285
282286 var version = new NugetPackageVersion ( catalogEntry . version ) ;
283- versions . Add ( version ) ;
287+ if ( includePrerelease || ! version . IsPrerelease )
288+ {
289+ versions . Add ( version ) ;
290+ }
291+
284292 if ( latestVersion != null && version <= latestVersion )
285293 {
286294 continue ;
287295 }
288296
289297 latestVersion = version ;
290298 latestVersionItem = leafObject ;
299+ if ( ! string . IsNullOrWhiteSpace ( catalogEntry . releaseNotes ) && lastNote != catalogEntry . releaseNotes && version > package . PackageVersion )
300+ {
301+ sb . Append ( catalogEntry . releaseNotes ) . Append ( "\n " ) ;
302+ lastNote = catalogEntry . releaseNotes ;
303+ }
291304 }
292305 }
293306
294307 versions . Sort ( ( v1 , v2 ) => v2 . CompareTo ( v1 ) ) ;
295- return CreatePackageFromRegistrationLeaf ( packageSource , latestVersionItem , versions ) ;
308+ return CreatePackageFromRegistrationLeaf ( packageSource , latestVersionItem , sb . ToString ( ) , versions ) ;
296309 }
297310
298311 /// <summary>
@@ -314,7 +327,7 @@ public async Task<NugetPackageV3> GetPackageWithDetailsAsync(
314327 return null ;
315328 }
316329
317- return CreatePackageFromRegistrationLeaf ( packageSource , leafItem ) ;
330+ return CreatePackageFromRegistrationLeaf ( packageSource , leafItem , leafItem . CatalogEntry . releaseNotes ) ;
318331 }
319332
320333 /// <summary>
@@ -343,6 +356,7 @@ public async Task<List<NugetFrameworkGroup>> GetPackageDetailsAsync(
343356 private static NugetPackageV3 CreatePackageFromRegistrationLeaf (
344357 NugetPackageSourceV3 packageSource ,
345358 RegistrationLeafObject leafItem ,
359+ string releaseNotes ,
346360 List < NugetPackageVersion > allVersions = null )
347361 {
348362 var entry = leafItem . CatalogEntry ;
@@ -368,6 +382,7 @@ private static NugetPackageV3 CreatePackageFromRegistrationLeaf(
368382 entry . summary ,
369383 entry . title ,
370384 entry . iconUrl ,
385+ releaseNotes ,
371386 allVersions ?? new List < NugetPackageVersion > { new NugetPackageVersion ( entry . version ) } )
372387 {
373388 DownloadUrl = leafItem . packageContent , Dependencies = ConvertDependencyGroups ( entry ) ,
@@ -443,6 +458,7 @@ private static List<INugetPackage> SearchResultToNugetPackages(List<SearchResult
443458 item . summary ,
444459 item . title ,
445460 item . iconUrl ,
461+ string . Empty ,
446462 versions ) ) ;
447463 }
448464
@@ -1017,6 +1033,9 @@ private sealed class CatalogEntry
10171033 [ CanBeNull ]
10181034 public string version ;
10191035
1036+ [ CanBeNull ]
1037+ public string releaseNotes ;
1038+
10201039 /// <summary>
10211040 /// The security vulnerabilities of the package.
10221041 /// </summary>
0 commit comments