Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .config/npm-packages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"chart.js": "4.5.1",
"chartjs-chart-geo": "4.3.6",
"luxon": "3.7.2",
"world-atlas": "2.0.2"
}
15 changes: 8 additions & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup>
<PackageVersion Include="DotMake.CommandLine" Version="3.1.0" />
<PackageVersion Include="NuGet.Versioning" Version="7.0.1" />
<PackageVersion Include="System.Text.Encodings.Web" Version="10.0.2" />
<PackageVersion Include="System.Text.Json" Version="10.0.2" />
</ItemGroup>
</Project>
<ItemGroup>
<PackageVersion Include="DotMake.CommandLine" Version="3.1.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.2" />
<PackageVersion Include="NuGet.Versioning" Version="7.0.1" />
<PackageVersion Include="System.Text.Encodings.Web" Version="10.0.2" />
<PackageVersion Include="System.Text.Json" Version="10.0.2" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions MissingMethodException.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@
<File Path=".config/npm-packages.json" />
</Folder>
<Project Path="DataTypes/DataTypes.csproj" />
<Project Path="NpmRegistry.Wrapper/NpmRegistry.Wrapper.csproj">
<BuildType Solution="CompileModels|*" Project="Release" />
<BuildType Solution="CompileSimulationModels|*" Project="Release" />
<BuildType Solution="CreateData|*" Project="Release" />
<BuildType Solution="Simulation|*" Project="Release" />
</Project>
</Solution>
13 changes: 13 additions & 0 deletions NpmRegistry.Wrapper/Models/Attestations.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Text.Json.Serialization;

namespace NpmRegistry.Wrapper.Models;
public class Attestations
{
[JsonPropertyName("url")]
#pragma warning disable CA1056 // URI-like properties should not be strings
public string Url { get; set; } = string.Empty;
#pragma warning restore CA1056 // URI-like properties should not be strings

[JsonPropertyName("provenance")]
public Provenance Provenance { get; set; } = new Provenance();
}
6 changes: 6 additions & 0 deletions NpmRegistry.Wrapper/Models/BinScript.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace NpmRegistry.Wrapper.Models;
public class BinScript
{
public string Name { get; set; } = string.Empty;
public string Path { get; set; } = string.Empty;
}
11 changes: 11 additions & 0 deletions NpmRegistry.Wrapper/Models/BinScriptCollection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace NpmRegistry.Wrapper.Models;
#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
public class BinScriptCollection
#pragma warning restore CA1711 // Identifiers should not have incorrect suffix
{
#pragma warning disable CA1002 // Do not expose generic lists
#pragma warning disable CA2227 // Collection properties should be read only
public List<BinScript> BinScripts { get; set; } = [];
#pragma warning restore CA2227 // Collection properties should be read only
#pragma warning restore CA1002 // Do not expose generic lists
}
6 changes: 6 additions & 0 deletions NpmRegistry.Wrapper/Models/Dependency.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace NpmRegistry.Wrapper.Models;
public class Dependency
{
public string Name { get; set; } = string.Empty;
public string Version { get; set; } = string.Empty;
}
9 changes: 9 additions & 0 deletions NpmRegistry.Wrapper/Models/DependencyList.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace NpmRegistry.Wrapper.Models;
public class DependencyList
{
#pragma warning disable CA1002 // Do not expose generic lists
#pragma warning disable CA2227 // Collection properties should be read only
public List<Dependency> Dependencies { get; set; } = [];
#pragma warning restore CA2227 // Collection properties should be read only
#pragma warning restore CA1002 // Do not expose generic lists
}
34 changes: 34 additions & 0 deletions NpmRegistry.Wrapper/Models/Dist.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System.Text.Json.Serialization;

namespace NpmRegistry.Wrapper.Models;

public class Dist
{
[JsonPropertyName("integrity")]
public string Integrity { get; set; } = string.Empty;

[JsonPropertyName("shasum")]
public string Shasum { get; set; } = string.Empty;

[JsonPropertyName("tarball")]
public string Tarball { get; set; } = string.Empty;

[JsonPropertyName("fileCount")]
public int FileCount { get; set; }

[JsonPropertyName("unpackedSize")]
public int UnpackedSize { get; set; }

[JsonPropertyName("signatures")]
#pragma warning disable CA1002 // Do not expose generic lists
#pragma warning disable CA2227 // Collection properties should be read only
public List<Signature> Signatures { get; set; } = [];
#pragma warning restore CA2227 // Collection properties should be read only
#pragma warning restore CA1002 // Do not expose generic lists

[JsonPropertyName("npm-signature")]
public string NpmSignature { get; set; } = string.Empty;

[JsonPropertyName("attestations")]
public Attestations? Attestations { get; set; }
}
11 changes: 11 additions & 0 deletions NpmRegistry.Wrapper/Models/DistTags.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Text.Json.Serialization;

namespace NpmRegistry.Wrapper.Models;

public class DistTags
{
[JsonPropertyName("next")]
public string Next { get; set; } = string.Empty;
[JsonPropertyName("latest")]
public string Latest { get; set; } = string.Empty;
}
28 changes: 28 additions & 0 deletions NpmRegistry.Wrapper/Models/ModelsSerializerContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using NpmRegistry.Wrapper.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace NpmRegistry.Wrapper.Models;

//[JsonSerializable(typeof(VersionList))]
//[JsonSerializable(typeof(Person))]
//[JsonSerializable(typeof(DistTags))]
//[JsonSerializable(typeof(NpmPackage))]
//[JsonSourceGenerationOptions(AllowTrailingCommas = true,
// Converters = [typeof(VersionListJsonConverter), typeof(PersonJsonConverter)],
// GenerationMode = JsonSourceGenerationMode.Default,
// IgnoreReadOnlyFields = false,
// IgnoreReadOnlyProperties = false,
// IncludeFields = false,
// MaxDepth = 15,
// NumberHandling = JsonNumberHandling.Strict,
// PreferredObjectCreationHandling = JsonObjectCreationHandling.Replace,
// ReadCommentHandling = JsonCommentHandling.Skip,
// RespectNullableAnnotations = true,
// UnknownTypeHandling = JsonUnknownTypeHandling.JsonElement,
// UnmappedMemberHandling = JsonUnmappedMemberHandling.Skip,
// UseStringEnumConverter = true,
// WriteIndented = false)]
//internal sealed partial class ModelsSerializerContext : JsonSerializerContext
//{
//}
12 changes: 12 additions & 0 deletions NpmRegistry.Wrapper/Models/NpmOperationalInternal.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;

namespace NpmRegistry.Wrapper.Models;

public class NpmOperationalInternal
{
[JsonPropertyName("host")]
public string Host { get; set; } = string.Empty;

[JsonPropertyName("tmp")]
public string Tmp { get; set; } = string.Empty;
}
47 changes: 47 additions & 0 deletions NpmRegistry.Wrapper/Models/NpmPackage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using NpmRegistry.Wrapper.Serialization;
using System.Text.Json.Serialization;

namespace NpmRegistry.Wrapper.Models;


public class NpmPackage
{
[JsonPropertyName("_id")]
public string Id { get; set; } = string.Empty;

[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;

[JsonPropertyName("dist-tags")]
public DistTags? DistTags { get; set; }

[JsonPropertyName("versions")]
[JsonConverter(typeof(VersionListJsonConverter))]
public VersionList? Versions { get; set; }

[JsonPropertyName("time")]
public NpmTime? Time { get; set; }

[JsonPropertyName("maintainers")]
#pragma warning disable CA1002 // Do not expose generic lists
#pragma warning disable CA2227 // Collection properties should be read only
public List<Person> Maintainers { get; set; } = [];
#pragma warning restore CA2227 // Collection properties should be read only
#pragma warning restore CA1002 // Do not expose generic lists

[JsonPropertyName("description")]
public string Description { get; set; } = string.Empty;

[JsonPropertyName("author")]
[JsonConverter(typeof(PersonJsonConverter))]
public Person? Author { get; set; }

[JsonPropertyName("license")]
public string License { get; set; } = string.Empty;

[JsonPropertyName("readme")]
public string Readme { get; set; } = string.Empty;

[JsonPropertyName("readmeFilename")]
public string ReadmeFilename { get; set; } = string.Empty;
}
28 changes: 28 additions & 0 deletions NpmRegistry.Wrapper/Models/NpmTime.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Text.Json.Serialization;

namespace NpmRegistry.Wrapper.Models;

public class NpmTime
{
[JsonPropertyName("created")]
public string Created { get; set; } = string.Empty;

[JsonPropertyName("modified")]
public string Modified { get; set; } = string.Empty;

[JsonPropertyName("unpublished")]
public UnpublishedTime? Unpublished { get; set; }
}

public class UnpublishedTime
{
[JsonPropertyName("time")]
public string Time { get; set; } = string.Empty;

[JsonPropertyName("versions")]
#pragma warning disable CA1002 // Do not expose generic lists
#pragma warning disable CA2227 // Collection properties should be read only
public List<string> Versions { get; set; } = [];
#pragma warning restore CA1002 // Do not expose generic lists
#pragma warning restore CA2227 // Collection properties should be read only
}
66 changes: 66 additions & 0 deletions NpmRegistry.Wrapper/Models/PackageVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
using NpmRegistry.Wrapper.Serialization;
using System.Text.Json.Serialization;

namespace NpmRegistry.Wrapper.Models;

public class PackageVersion
{
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;

[JsonPropertyName("version")]
public string Version { get; set; } = string.Empty;

[JsonPropertyName("description")]
public string Description { get; set; } = string.Empty;

[JsonPropertyName("main")]
public string Main { get; set; } = string.Empty;

[JsonPropertyName("bin")]
[JsonConverter(typeof(BinScriptConverter))]
public BinScriptCollection? BinScripts { get; set; }

[JsonPropertyName("scripts")]
[JsonConverter(typeof(ScriptListJsonConverter))]
public ScriptList? Scripts { get; set; }

[JsonPropertyName("author")]
[JsonConverter(typeof(PersonJsonConverter))]
public Person? Author { get; set; }

[JsonPropertyName("license")]
public string License { get; set; } = string.Empty;

[JsonPropertyName("_id")]
public string Id { get; set; } = string.Empty;

[JsonPropertyName("_nodeVersion")]
public string NodeVersion { get; set; } = string.Empty;

[JsonPropertyName("_npmVersion")]
public string NpmVersion { get; set; } = string.Empty;

[JsonPropertyName("dist")]
public Dist? Dist { get; set; }

[JsonPropertyName("_npmUser")]
public Person? NpmUser { get; set; }

[JsonPropertyName("maintainers")]
#pragma warning disable CA1002 // Do not expose generic lists
#pragma warning disable CA2227 // Collection properties should be read only
public List<Person> Maintainers { get; set; } = [];
#pragma warning restore CA1002 // Do not expose generic lists
#pragma warning restore CA2227 // Collection properties should be read only

[JsonPropertyName("_npmOperationalInternal")]
public NpmOperationalInternal? NpmOperationalInternal { get; set; }

[JsonPropertyName("_hasShrinkwrap")]
public bool HasShrinkwrap { get; set; }

[JsonPropertyName("dependencies")]
[JsonConverter(typeof(DependencyListJsonConverter))]
public DependencyList Dependencies { get; set; } = new();
}
12 changes: 12 additions & 0 deletions NpmRegistry.Wrapper/Models/Person.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;

namespace NpmRegistry.Wrapper.Models;

public class Person
{
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;

[JsonPropertyName("email")]
public string Email { get; set; } = string.Empty;
}
8 changes: 8 additions & 0 deletions NpmRegistry.Wrapper/Models/Provenance.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System.Text.Json.Serialization;

namespace NpmRegistry.Wrapper.Models;
public class Provenance
{
[JsonPropertyName("predicateType")]
public string PredicateType { get; set; } = string.Empty;
}
7 changes: 7 additions & 0 deletions NpmRegistry.Wrapper/Models/Script.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace NpmRegistry.Wrapper.Models;

public class Script
{
public string Operation { get; set; } = string.Empty;
public string Content { get; set; } = string.Empty;
}
10 changes: 10 additions & 0 deletions NpmRegistry.Wrapper/Models/ScriptList.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace NpmRegistry.Wrapper.Models;

public class ScriptList
{
#pragma warning disable CA1002 // Do not expose generic lists
#pragma warning disable CA2227 // Collection properties should be read only
public List<Script> PackageScripts { get; set; } = [];
#pragma warning restore CA1002 // Do not expose generic lists
#pragma warning restore CA2227 // Collection properties should be read only
}
12 changes: 12 additions & 0 deletions NpmRegistry.Wrapper/Models/Signature.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;

namespace NpmRegistry.Wrapper.Models;

public class Signature
{
[JsonPropertyName("keyid")]
public string Keyid { get; set; } = string.Empty;

[JsonPropertyName("sig")]
public string Sig { get; set; } = string.Empty;
}
10 changes: 10 additions & 0 deletions NpmRegistry.Wrapper/Models/VersionList.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace NpmRegistry.Wrapper.Models;

public class VersionList
{
#pragma warning disable CA1002 // Do not expose generic lists
#pragma warning disable CA2227 // Collection properties should be read only
public List<PackageVersion> PackageVersions { get; set; } = [];
#pragma warning restore CA1002 // Do not expose generic lists
#pragma warning restore CA2227 // Collection properties should be read only
}
Loading