using System.Net.Sockets; using System.ComponentModel.DataAnnotations; using Newtonsoft.Json; using isnd.Data.Packages; using NuGet.Versioning; using System.Collections.Generic; using System; using isnd.Interfaces; namespace isnd.Data.Catalog { public class CatalogEntry : HappyIdOwner , IObject// , IPackageDetails { /// /// Creates a catalog entry /// /// package details url /// public CatalogEntry(string id): base(id) { } /// /// The ID of the package /// /// [JsonProperty("id")] public string Id { get; set; } /// /// The Package details url /// /// [JsonProperty("@id")] public string refid { get => GetId(); } [JsonProperty("@type")] public string[] RefType { get; protected set; } = new string[] { "PackageDetail" }; [JsonProperty("commitId")] public string CommitId { get; set; } [JsonProperty("commitTimeStamp")] public DateTime CommitTimeStamp { get; set; } /// /// Authors /// /// string or array of strings public string authors { get; set; } /// /// The dependencies of the package, grouped by target framework /// /// array of objects public DependencyGroup[] dependencyGroups { get; set; } /// /// The deprecation associated with the package /// /// public Deprecation deprecation { get; set; } [JsonProperty("description")] public string Description { get; set; } public string iconUrl { get; set; } public string language { get; set; } public string licenseUrl { get; set; } public string licenseExpression { get; set; } /// /// Should be considered as listed if absent /// /// public bool listed { get; set; } public string minClientVersion { get; set; } public string projectUrl { get; set; } public bool requireLicenseAcceptance { get; set; } public string summary { get; set; } /// /// The tags /// /// public string tags { get; set; } public string title { get; set; } /// /// The security vulnerabilities of the package /// /// public Vulnerabilitie[] vulnerabilities { get; set; } public string packageContent { get; set; } /// /// A string containing a ISO 8601 timestamp of when the package was published /// /// [JsonProperty("published")] public DateTime Published { get; set; } /// /// The full version string after normalization /// /// [Required,JsonRequired] [JsonProperty("version")] public string Version { get; set; } } }