feature: first
All checks were successful
Build / Compute Version (push) Successful in 4s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 2m47s
Build / Build Nuget package (CringePlugins) (push) Successful in 5m31s
Build / Build Nuget package (NuGet) (push) Successful in 6m2s
Build / Build Nuget package (SharedCringe) (push) Successful in 7m25s
Build / Build Launcher (push) Successful in 9m11s
All checks were successful
Build / Compute Version (push) Successful in 4s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 2m47s
Build / Build Nuget package (CringePlugins) (push) Successful in 5m31s
Build / Build Nuget package (NuGet) (push) Successful in 6m2s
Build / Build Nuget package (SharedCringe) (push) Successful in 7m25s
Build / Build Launcher (push) Successful in 9m11s
This commit is contained in:
9
NuGet/Models/CatalogEntry.cs
Normal file
9
NuGet/Models/CatalogEntry.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System.Collections.Immutable;
|
||||
using NuGet.Versioning;
|
||||
|
||||
namespace NuGet.Models;
|
||||
|
||||
public record CatalogEntry(string Id, NuGetVersion Version, ImmutableArray<DependencyGroup> DependencyGroups, ImmutableArray<string>? PackageTypes,
|
||||
ImmutableArray<CatalogPackageEntry>? PackageEntries);
|
||||
|
||||
public record CatalogPackageEntry(string Name, string FullName, long CompressedLength, long Length);
|
5
NuGet/Models/Dependency.cs
Normal file
5
NuGet/Models/Dependency.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using NuGet.Versioning;
|
||||
|
||||
namespace NuGet.Models;
|
||||
|
||||
public record Dependency(string Id, VersionRange Range);
|
6
NuGet/Models/DependencyGroup.cs
Normal file
6
NuGet/Models/DependencyGroup.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using System.Collections.Immutable;
|
||||
using NuGet.Frameworks;
|
||||
|
||||
namespace NuGet.Models;
|
||||
|
||||
public record DependencyGroup(NuGetFramework TargetFramework, ImmutableArray<Dependency>? Dependencies = null);
|
5
NuGet/Models/NuGetIndex.cs
Normal file
5
NuGet/Models/NuGetIndex.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using NuGet.Versioning;
|
||||
|
||||
namespace NuGet.Models;
|
||||
|
||||
public record NuGetIndex(NuGetVersion Version, Resource[] Resources);
|
6
NuGet/Models/Registration.cs
Normal file
6
NuGet/Models/Registration.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace NuGet.Models;
|
||||
|
||||
public record Registration([property: JsonPropertyName("catalogEntry")] string CatalogEntryUrl,
|
||||
[property: JsonPropertyName("sleet:catalogEntry")] CatalogEntry? SleetEntry);
|
3
NuGet/Models/RegistrationEntry.cs
Normal file
3
NuGet/Models/RegistrationEntry.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace NuGet.Models;
|
||||
|
||||
public record RegistrationEntry(CatalogEntry CatalogEntry);
|
5
NuGet/Models/RegistrationPage.cs
Normal file
5
NuGet/Models/RegistrationPage.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using NuGet.Versioning;
|
||||
|
||||
namespace NuGet.Models;
|
||||
|
||||
public record RegistrationPage(int Count, NuGetVersion Lower, NuGetVersion Upper, RegistrationEntry[] Items);
|
3
NuGet/Models/RegistrationRoot.cs
Normal file
3
NuGet/Models/RegistrationRoot.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace NuGet.Models;
|
||||
|
||||
public record RegistrationRoot(int Count, RegistrationPage[] Items);
|
5
NuGet/Models/Resource.cs
Normal file
5
NuGet/Models/Resource.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace NuGet.Models;
|
||||
|
||||
public record Resource([property: JsonPropertyName("@id")] string Url, [property: JsonPropertyName("@type")] ResourceType Type, string? Comment);
|
26
NuGet/Models/ResourceType.cs
Normal file
26
NuGet/Models/ResourceType.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using NuGet.Converters;
|
||||
using NuGet.Versioning;
|
||||
|
||||
namespace NuGet.Models;
|
||||
|
||||
[JsonConverter(typeof(ResourceTypeJsonConverter))]
|
||||
public record ResourceType(string Id, NuGetVersion? Version)
|
||||
{
|
||||
public static ResourceType Parse(string typeString)
|
||||
{
|
||||
var slash = typeString.IndexOf('/');
|
||||
|
||||
if (slash < 0)
|
||||
return new ResourceType(typeString, null);
|
||||
|
||||
var id = typeString[..slash];
|
||||
var versionStr = typeString[(slash + 1)..];
|
||||
|
||||
return NuGetVersion.TryParse(versionStr, out var version)
|
||||
? new ResourceType(id, version)
|
||||
: new ResourceType(id, null);
|
||||
}
|
||||
|
||||
public override string ToString() => $"{Id}/{Version}";
|
||||
}
|
Reference in New Issue
Block a user