This commit is contained in:
Paul Schneider 2022-09-25 02:24:21 +01:00
commit f46ca00de9
13 changed files with 105 additions and 125 deletions

View file

@ -4,6 +4,10 @@ namespace isnd.Data.Catalog
{
public class PackageRegistrationIndexQuery : RegistrationPageIndex
{
public PackageRegistrationIndexQuery(string id) : base(id)
{
}
[JsonProperty("prerelease")]
public bool Prerelease { get; set; }

View file

@ -1,32 +0,0 @@
using System;
using isnd.Interfaces;
using Newtonsoft.Json;
namespace isnd.Data.Catalog
{
public class PageRef : IObject
{
/// <summary>
/// Page Url
/// </summary>
/// <value></value>
[JsonProperty("@id")]
public string Id { get; set; }
/// <summary>
/// Page entry count
/// </summary>
/// <value></value>
[JsonProperty("count")]
public int Count { get; set; }
[JsonProperty("commitId")]
public string CommitId { get; set; }
[JsonProperty("commitTimeStamp")]
public DateTime CommitTimeStamp { get; set; }
}
}

View file

@ -3,6 +3,10 @@ using Newtonsoft.Json;
namespace isnd.Data.Catalog
{
/// <summary>
/// Hosts a catalog entry,
/// the atomic content reference
/// </summary>
public class RegistrationLeaf
{
/*

View file

@ -1,24 +1,18 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace isnd.Data.Catalog
{
public class RegistrationPage
public class RegistrationPage
{
/// <summary>
/// The URL to the registration page
/// </summary>
/// <value></value>
[JsonProperty("@id"), JsonRequired]
public string Id { get; set; }
/// <summary>
/// The number of registration leaves in the page
/// </summary>
/// <value></value>
[JsonProperty("count"), JsonRequired]
public int Count { get; set; }
[JsonProperty("@id")]
[JsonRequired]
public string Id { get; }
public RegistrationPage (string id)
{
Id = id;
}
/// <summary>
/// no The array of registration leaves and their associate metadata
@ -26,7 +20,7 @@ namespace isnd.Data.Catalog
/// <value></value>
[JsonProperty("items")]
public RegistrationLeaf[] Items { get; set; }
public List<RegistrationLeaf> Items { get; set; }
/// <summary>
/// The highest SemVer 2.0.0 version in the page (inclusive)
/// </summary>
@ -47,5 +41,9 @@ namespace isnd.Data.Catalog
[JsonProperty("parent")]
public string Parent { get; set; }
[JsonProperty("count")]
public int Count { get; internal set; }
public string CommitId { get; internal set; }
public DateTime CommitTimeStamp { get; internal set; }
}
}

View file

@ -1,13 +1,38 @@
using Newtonsoft.Json;
using System.Collections.Generic;
namespace isnd.Data.Catalog
{
public class RegistrationPageIndex
{
/// <summary>
/// Page Url
/// </summary>
/// <value></value>
[JsonProperty("@id")]
public string Id { get; set; }
public RegistrationPageIndex(string id)
{
Id = id;
Items = new List<RegistrationPage>();
}
public RegistrationPageIndex(IEnumerable<RegistrationPage> pages)
{
Items = new List<RegistrationPage>(pages);
}
public RegistrationPageIndex(string id, IEnumerable<RegistrationLeaf> leaves) : this(id)
{
// leaves;
}
[JsonProperty("count")]
public int Count { get => Items?.Length ?? 0; }
public int Count { get => Items?.Count ?? 0; }
[JsonProperty("items")]
public RegistrationPage[] Items { get; set; }
public List<RegistrationPage> Items { get; set; }
public string CommitId { get; set; }
}
}

View file

@ -1,26 +0,0 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using isnd.Interfaces;
using isnd.Data.Catalog;
namespace isnd.Data.Packages.Catalog
{
public class CatalogIndex : IObject
{
[JsonProperty("@id")]
public string Id { get; set ; }
[JsonProperty("items")]
public List<PageRef> Items { get; set; }
[JsonProperty("count")]
public int Count { get => Items?.Count ?? 0; }
public string CommitId { get; set; }
public DateTime CommitTimeStamp { get; set; }
}
}

View file

@ -57,7 +57,7 @@ namespace isnd.Data.Packages
var v = Versions.First();
RegistrationLeaf leave = new RegistrationLeaf
{
Id = bid + Id + ".json",
Id = bid + Id + "/" + v.FullString + ".json",
PackageContent = v.NugetLink,
Entry = new CatalogEntry
{