|
|
|
|
@ -16,7 +16,7 @@ using isnd.Entities;
|
|
|
|
|
|
|
|
|
|
namespace isnd.Data.Catalog
|
|
|
|
|
{
|
|
|
|
|
public class PackageDetails : Permalink, IObject, IPackageSearchMetadata
|
|
|
|
|
public class PackageDetails : Permalink, IObject
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates a catalog entry
|
|
|
|
|
@ -24,7 +24,7 @@ namespace isnd.Data.Catalog
|
|
|
|
|
/// <param name="pkg">package id</param>
|
|
|
|
|
/// <param name="apiBase">api Base</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public PackageDetails(PackageVersion pkg, string apiBase): base( apiBase + ApiConfig.Registration + "/" + pkg.PackageId + "/" + pkg.FullString + ".json")
|
|
|
|
|
public PackageDetails(PackageVersion pkg, string apiBase): base( apiBase + ApiConfig.Package + "/" + pkg.PackageId + "/" + pkg.FullString)
|
|
|
|
|
{
|
|
|
|
|
Title = PackageId = pkg.Package.Id;
|
|
|
|
|
Version = pkg.FullString;
|
|
|
|
|
@ -32,80 +32,18 @@ namespace isnd.Data.Catalog
|
|
|
|
|
packageContent = apiBase + pkg.NugetLink;
|
|
|
|
|
CommitId = pkg.CommitId;
|
|
|
|
|
Published = CommitTimeStamp = pkg.LatestCommit.CommitTimeStamp;
|
|
|
|
|
IsListed = !pkg.IsDeleted && pkg.Package.Public;
|
|
|
|
|
Listed = !pkg.IsDeleted && pkg.Package.Public;
|
|
|
|
|
if (pkg.DependencyGroups!=null)
|
|
|
|
|
{
|
|
|
|
|
DependencySets = pkg.DependencyGroups;
|
|
|
|
|
}
|
|
|
|
|
PackageDetailsUrl = new Uri(this.id);
|
|
|
|
|
|
|
|
|
|
// TODO Licence Project Urls, Summary, Title, Owners, etc ...
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[JsonProperty("@type")]
|
|
|
|
|
public string[] RefType { get; protected set; } = new string[] { "PackageDetails" };
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="apiBase"></param>
|
|
|
|
|
/// <param name="pkgId"></param>
|
|
|
|
|
/// <param name="pkgVersionString"></param>
|
|
|
|
|
/// <param name="commitId"></param>
|
|
|
|
|
/// <param name="commitTimeStamp"></param>
|
|
|
|
|
/// <param name="authors"></param>
|
|
|
|
|
/// <param name="deprecation"></param>
|
|
|
|
|
/// <param name="description"></param>
|
|
|
|
|
/// <param name="iconUrl"></param>
|
|
|
|
|
/// <param name="language"></param>
|
|
|
|
|
/// <param name="licenseUrl"></param>
|
|
|
|
|
/// <param name="licenseExpression"></param>
|
|
|
|
|
/// <param name="minClientVersion"></param>
|
|
|
|
|
/// <param name="projectUrl"></param>
|
|
|
|
|
/// <param name="requireLicenseAcceptance"></param>
|
|
|
|
|
/// <param name="summary"></param>
|
|
|
|
|
/// <param name="tags"></param>
|
|
|
|
|
/// <param name="title"></param>
|
|
|
|
|
/// <param name="packageContent"></param>
|
|
|
|
|
/// <param name="version"></param>
|
|
|
|
|
/// <param name="identity"></param>
|
|
|
|
|
/// <param name="readmeUrl"></param>
|
|
|
|
|
/// <param name="reportAbuseUrl"></param>
|
|
|
|
|
/// <param name="packageDetailsUrl"></param>
|
|
|
|
|
/// <param name="owners"></param>
|
|
|
|
|
/// <param name="isListed"></param>
|
|
|
|
|
/// <param name="prefixReserved"></param>
|
|
|
|
|
/// <param name="licenseMetadata"></param>
|
|
|
|
|
public PackageDetails(string apiBase, string pkgId, string pkgVersionString, string commitId, DateTimeOffset commitTimeStamp, string authors, Deprecation deprecation, string description, Uri iconUrl, string language, Uri licenseUrl, string licenseExpression, string minClientVersion, Uri projectUrl, bool requireLicenseAcceptance, string summary, string tags, string title, string packageContent, string version, PackageIdentity identity, Uri readmeUrl, Uri reportAbuseUrl, Uri packageDetailsUrl, string owners, bool isListed, bool prefixReserved, LicenseMetadata licenseMetadata)
|
|
|
|
|
: base( apiBase + ApiConfig.Registration + "/" + pkgId + "/" + pkgVersionString + ".json")
|
|
|
|
|
{
|
|
|
|
|
this.CommitId = commitId;
|
|
|
|
|
this.CommitTimeStamp = commitTimeStamp;
|
|
|
|
|
this.Authors = authors;
|
|
|
|
|
this.deprecation = deprecation;
|
|
|
|
|
this.Description = description;
|
|
|
|
|
this.IconUrl = iconUrl;
|
|
|
|
|
this.language = language;
|
|
|
|
|
this.LicenseUrl = licenseUrl;
|
|
|
|
|
this.licenseExpression = licenseExpression;
|
|
|
|
|
this.minClientVersion = minClientVersion;
|
|
|
|
|
this.ProjectUrl = projectUrl;
|
|
|
|
|
this.RequireLicenseAcceptance = requireLicenseAcceptance;
|
|
|
|
|
this.Summary = summary;
|
|
|
|
|
this.Tags = tags;
|
|
|
|
|
this.Title = title;
|
|
|
|
|
this.packageContent = packageContent;
|
|
|
|
|
this.Version = version;
|
|
|
|
|
this.Identity = identity;
|
|
|
|
|
this.ReadmeUrl = readmeUrl;
|
|
|
|
|
this.ReportAbuseUrl = reportAbuseUrl;
|
|
|
|
|
this.PackageDetailsUrl = packageDetailsUrl;
|
|
|
|
|
this.Owners = owners;
|
|
|
|
|
this.IsListed = isListed;
|
|
|
|
|
this.PrefixReserved = prefixReserved;
|
|
|
|
|
this.LicenseMetadata = licenseMetadata;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[JsonProperty("commitId")]
|
|
|
|
|
public string CommitId { get; set; }
|
|
|
|
|
@ -198,22 +136,19 @@ namespace isnd.Data.Catalog
|
|
|
|
|
|
|
|
|
|
public Uri ReportAbuseUrl { get; set; }
|
|
|
|
|
|
|
|
|
|
public Uri PackageDetailsUrl { get; set; }
|
|
|
|
|
|
|
|
|
|
public string Owners { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty("isListed")]
|
|
|
|
|
public bool IsListed { get; set; }
|
|
|
|
|
public bool Listed { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool PrefixReserved { get; set; }
|
|
|
|
|
|
|
|
|
|
public LicenseMetadata LicenseMetadata { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[JsonProperty("dependencyGroups")]
|
|
|
|
|
public IEnumerable<PackageDependencyGroup> DependencySets {get; set;}
|
|
|
|
|
|
|
|
|
|
IEnumerable<NuGet.Packaging.PackageDependencyGroup> IPackageSearchMetadata.DependencySets => throw new NotImplementedException();
|
|
|
|
|
|
|
|
|
|
public Task<PackageDeprecationMetadata> GetDeprecationMetadataAsync()
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
|