DUB Client
Stand-alone library to provide convenient access to the REST API of a dub repository. Deserializes the json from the API for convenient use within a JVM language such as Java or Kotlin.
https://code.dlang.org/api/packages/search?q=
https://code.dlang.org/api/packages/{package}/info
https://code.dlang.org/api/packages/{package}/{version}/info
https://code.dlang.org/api/packages/{package}/stats
https://code.dlang.org/api/packages/{package}/{version}/stats
https://code.dlang.org/api/packages/{package}/latest
The API for the dub registry can be found here:
interface IPackages {
@safe:
@method(HTTPMethod.GET)
SearchResult[] search(string q = "");
@path(":name/latest")
string getLatestVersion(string _name);
@path(":name/stats")
DbPackageStats getStats(string _name);
@path(":name/:version/stats")
DownloadStats getStats(string _name, string _version);
@path(":name/info")
Json getInfo(string _name);
@path(":name/:version/info")
Json getInfo(string _name, string _version);
}
This package requires Apache HTTP Client v4.5.*, Gson v2.8, and uses slf4j-api for logging. It's intended for use in the Intellij-DUB plugin but may also be helpful to other projects.