Skip to content

Commit

Permalink
Add release notes property to response (#112)
Browse files Browse the repository at this point in the history
* add release notes and compatibility matrix properties

* Update GregClientTests.cs

* update test

* add rn to response

* Update GregClientTests.cs
  • Loading branch information
zeusongit authored Sep 18, 2024
1 parent 33d27aa commit 52952e4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
32 changes: 32 additions & 0 deletions src/GregClient/Requests/PackageUploadRequestBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,38 @@ public PackageUploadRequestBody()
{
}

public PackageUploadRequestBody(string name, string version, string description,
IEnumerable<string> keywords, string license,
string contents, string engine, string engineVersion,
string metadata, string group, IEnumerable<PackageDependency> dependencies,
string siteUrl, string repositoryUrl, bool containsBinaries,
IEnumerable<string> nodeLibraryNames, IEnumerable<string> hostDependencies,
string copyright_holder, string copyright_year, string releaseNotesUrl)
{
this.host_dependencies = hostDependencies;
this.copyright_holder = copyright_holder;
this.copyright_year = copyright_year;
this.release_notes_url = releaseNotesUrl;

this.name = name;
this.version = version;
this.description = description;
this.keywords = keywords;
this.dependencies = dependencies;
this.contents = contents;
this.engine = engine;
this.group = group;
this.engine_version = engineVersion;
this.engine_metadata = metadata;
this.site_url = siteUrl;
this.repository_url = repositoryUrl;
this.contains_binaries = containsBinaries;
this.node_libraries = nodeLibraryNames;

this.license = license;
}

[Obsolete("This constructor may not initiate all the properties and will be removed in a future release of PackageManagerClient.")]
public PackageUploadRequestBody(string name, string version, string description,
IEnumerable<string> keywords, string license,
string contents, string engine, string engineVersion,
Expand Down
4 changes: 2 additions & 2 deletions src/GregClient/Requests/PackageVersionUploadRequestBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public PackageVersionUploadRequestBody(string name, string version, string descr
this.contains_binaries = containsBinaries;
this.node_libraries = nodeLibraryNames;
this.compatibility_matrix = compatibility_matrix;
this.releaseNotesUrl = releaseNotesUrl;
this.release_notes_url = releaseNotesUrl;
}

/// <summary>
Expand Down Expand Up @@ -133,6 +133,6 @@ public PackageVersionUploadRequestBody(string name, string version, string descr
public string copyright_holder { get; set; }
public string copyright_year { get; set; }
public string compatibility_matrix { get; set; }
public string releaseNotesUrl { get; set; }
public string release_notes_url { get; set; }
}
}
1 change: 1 addition & 0 deletions src/GregClient/Responses/Responses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public class PackageVersion
public string latest_version_update { get; set; }

public string size { get; set; }
public string release_notes_url { get; set; }
}

public class User
Expand Down
4 changes: 2 additions & 2 deletions src/GregClientTests/GregClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void UploadDynamoPackageVersionTest()

var files = new List<string>() { "../test/pedro.dyf", "../test/RootNode.dyf" };
var request = new PackageVersionUpload(nv, files);
Assert.That(request.RequestBody.AsJson().Equals("{\"file_hash\":null,\"name\":\"Third .NET Package\",\"version\":\"2.1.0\",\"description\":\"\",\"group\":\"group\",\"keywords\":[\"neat\",\"ok\"],\"dependencies\":[{\"name\":\"peter\",\"version\":\"0.1.0\"},{\"name\":\"stephen\",\"version\":\"0.1.0\"}],\"host_dependencies\":[],\"contents\":\"contents\",\"engine_version\":\"0.1.0\",\"engine\":\"dynamo\",\"engine_metadata\":\"metadata\",\"site_url\":\"\",\"repository_url\":\"\",\"contains_binaries\":false,\"node_libraries\":[],\"copyright_holder\":\"Dynamo Team\",\"copyright_year\":\"2021\",\"compatibility_matrix\":\"\",\"releaseNotesUrl\":\"\"}"));
Assert.That(request.RequestBody.AsJson().Equals("{\"file_hash\":null,\"name\":\"Third .NET Package\",\"version\":\"2.1.0\",\"description\":\"\",\"group\":\"group\",\"keywords\":[\"neat\",\"ok\"],\"dependencies\":[{\"name\":\"peter\",\"version\":\"0.1.0\"},{\"name\":\"stephen\",\"version\":\"0.1.0\"}],\"host_dependencies\":[],\"contents\":\"contents\",\"engine_version\":\"0.1.0\",\"engine\":\"dynamo\",\"engine_metadata\":\"metadata\",\"site_url\":\"\",\"repository_url\":\"\",\"contains_binaries\":false,\"node_libraries\":[],\"copyright_holder\":\"Dynamo Team\",\"copyright_year\":\"2021\",\"compatibility_matrix\":\"\",\"release_notes_url\":\"\"}"));
Console.WriteLine(request.RequestBody.AsJson());
}

Expand All @@ -74,7 +74,7 @@ public void UploadDynamoPackageWithHostDependencyTest()

var files = new List<string>() { "../test/pedro.dyf", "../test/RootNode.dyf" };
var request = new PackageVersionUpload(nv, files);
Assert.That(request.RequestBody.AsJson().Equals("{\"file_hash\":null,\"name\":\"Third .NET Package\",\"version\":\"2.1.0\",\"description\":\"\",\"group\":\"group\",\"keywords\":[\"Civil\"],\"dependencies\":[{\"name\":\"Ram\",\"version\":\"0.1.0\"},{\"name\":\"Ian\",\"version\":\"0.1.0\"}],\"host_dependencies\":[\"Civil3D\"],\"contents\":\"contents\",\"engine_version\":\"0.1.0\",\"engine\":\"dynamo\",\"engine_metadata\":\"metadata\",\"site_url\":\"\",\"repository_url\":\"\",\"contains_binaries\":false,\"node_libraries\":[],\"copyright_holder\":\"Dynamo Team\",\"copyright_year\":\"2021\",\"compatibility_matrix\":\"\",\"releaseNotesUrl\":\"\"}"));
Assert.That(request.RequestBody.AsJson().Equals("{\"file_hash\":null,\"name\":\"Third .NET Package\",\"version\":\"2.1.0\",\"description\":\"\",\"group\":\"group\",\"keywords\":[\"Civil\"],\"dependencies\":[{\"name\":\"Ram\",\"version\":\"0.1.0\"},{\"name\":\"Ian\",\"version\":\"0.1.0\"}],\"host_dependencies\":[\"Civil3D\"],\"contents\":\"contents\",\"engine_version\":\"0.1.0\",\"engine\":\"dynamo\",\"engine_metadata\":\"metadata\",\"site_url\":\"\",\"repository_url\":\"\",\"contains_binaries\":false,\"node_libraries\":[],\"copyright_holder\":\"Dynamo Team\",\"copyright_year\":\"2021\",\"compatibility_matrix\":\"\",\"release_notes_url\":\"\"}"));
Console.WriteLine(request.RequestBody.AsJson());
}

Expand Down

0 comments on commit 52952e4

Please sign in to comment.