|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using isnd.Entities;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using isn.abst;
|
|
|
|
|
|
|
|
|
|
namespace isnd.Data.Catalog
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Hosts a catalog entry,
|
|
|
|
|
/// the atomic content reference
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class Package
|
|
|
|
|
{
|
|
|
|
|
public Package(string apiBase, string pkgId, string fullVersionString, CatalogEntry entry)
|
|
|
|
|
{
|
|
|
|
|
this.registration = apiBase + ApiConfig.Registration + "/" + pkgId + "/index.json";
|
|
|
|
|
this.PackageContent = apiBase + ApiConfig.Nuget + "/" + pkgId + "/" + fullVersionString
|
|
|
|
|
+ "/" + pkgId + "-" + fullVersionString + "." + Constants.PaquetFileEstension;
|
|
|
|
|
Entry = entry;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
@id string yes
|
|
|
|
|
catalogEntry object yes
|
|
|
|
|
packageContent string yes
|
|
|
|
|
*/
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The URL to the registration leaf
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value></value>
|
|
|
|
|
[JsonProperty("@id")]
|
|
|
|
|
[Key][Required]
|
|
|
|
|
[StringLength(1024)]
|
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The catalog entry containing the package metadata
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value></value>
|
|
|
|
|
[JsonProperty("catalogEntry")]
|
|
|
|
|
public CatalogEntry Entry { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The URL to the package content (.nupkg)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value></value>
|
|
|
|
|
[JsonProperty("packageContent")]
|
|
|
|
|
public string PackageContent { get; set; }
|
|
|
|
|
|
|
|
|
|
public string registration { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|