KallitheaApiClient 0.7.0-lib.23

This is a prerelease version of KallitheaApiClient.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package KallitheaApiClient --version 0.7.0-lib.23
NuGet\Install-Package KallitheaApiClient -Version 0.7.0-lib.23
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KallitheaApiClient" Version="0.7.0-lib.23" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KallitheaApiClient --version 0.7.0-lib.23
#r "nuget: KallitheaApiClient, 0.7.0-lib.23"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install KallitheaApiClient as a Cake Addin
#addin nuget:?package=KallitheaApiClient&version=0.7.0-lib.23&prerelease

// Install KallitheaApiClient as a Cake Tool
#tool nuget:?package=KallitheaApiClient&version=0.7.0-lib.23&prerelease

KallitheaApiClient

NugetShield

This is Kallithea API client library for .NET. (unofficial)
Kallithea is a self-hosted repository hosting WEB application.

It's a relatively simple mapper to the API's JSON interface, so it should be easy to match with the Kallithea API documentation.
Sorry, IntelliSense messages (documentation comments) for types and members are provided in Japanese. This is because I currently think that the main users are me and the people around me.

Package and API version

Although the Kallithea API specification may change from version to version, this library targets only a single version.
If the version targeted by the library does not match the server version, there is a large possibility that it will not work properly.

Package versions are in semantic versioning format, but are numbered according to the following arrangement.
Always used the pre-release versioning for this package version number.
The core version part represents the version of the target server.
The pre-release version part is used to represent the library version, not as a pre-release.
The first of the pre-release version numbers is changed when the library specification changes (binary incompatibility).
The second pre-release version number is changed for bug fixes and other cases where binary compatibility is maintained.

Examples

Some samples are shown below.
These use C#9 or later syntax.

Creation of users, repositories, etc.

var apiUrl = new Uri("http://<your-hosting-server>/_admin/api");
var apiKey = "<your-api-key>";
using var client = new KallitheaClient(apiUrl, apiKey);

await client.CreateUserAsync(new("foo", "foo@example.com", "family", "given", password: "foo123"));

await client.CreateUserGroupAsync(new("all"));
await client.AddUserToUserGroupAsync(new("all", "admin"));
await client.AddUserToUserGroupAsync(new("all", "foo"));

await client.CreateUserGroupAsync(new("tester"));
await client.AddUserToUserGroupAsync(new("tester", "foo"));

await client.CreateRepoGroupAsync(new("share"));
await client.GrantUserGroupPermToRepoGroupAsync(new("share", "tester", RepoGroupPerm.admin));

await client.CreateRepoGroupAsync(new("users"));
await client.CreateRepoGroupAsync(new("foo", parent: "users"));
await client.GrantUserPermToRepoGroupAsync(new("users/foo", "foo", RepoGroupPerm.admin));

await client.CreateRepoAsync(new("users/foo/repo1", owner: "foo", repo_type: RepoType.git));
await client.CreateRepoAsync(new("users/foo/repo2", owner: "foo", repo_type: RepoType.hg));

Displays the most recent changesets for each repository.

var apiUrl = new Uri("http://<your-hosting-server>/_admin/api");
var apiKey = "<your-api-key>";
using var client = new SimpleKallitheaClient(apiUrl, apiKey);

var repositories = await client.GetReposAsync();
foreach (var repo in repositories)
{
    Console.WriteLine($"{repo.repo_name}: RepoType={repo.repo_type}, Owner={repo.owner}");
    try
    {
        var args = new GetChangesetsArgs(repo.repo_name, max_revisions: "3", reverse: true);
        var changesets = await client.GetChangesetsAsync(args);
        foreach (var change in changesets)
        {
            var msgline = change.summary.message?.Split('\r', '\n')[0].Trim();
            Console.WriteLine($"  {change.summary.short_id} : {msgline}");
        }
    }
    catch (Exception ex)
    {
        Console.WriteLine($"  Can't get changeset : {ex.Message}");
    }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.7.0-lib.23.private.1 81 12/1/2023
0.7.0-lib.23.patch... 1,244 12/1/2023
0.7.0-lib.23 62 12/1/2023