Skip to content
Merged
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
7 changes: 7 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@
<PackageProjectUrl>https://github.com/Chrison-dev/UnifiSharp</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<!-- Embed the repo README in every package so nuget.org renders it. -->
<PackageReadmeFile>README.md</PackageReadmeFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Embed symbols in the assembly (GitHub Packages doesn't take .snupkg). -->
<DebugType>embedded</DebugType>
</PropertyGroup>

<!-- Pack the repo-root README into every packable project. -->
<ItemGroup Condition="Exists('$(MSBuildThisFileDirectory)README.md')">
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" Visible="false" />
</ItemGroup>

</Project>
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
# UnifiSharp

[![NuGet](https://img.shields.io/nuget/v/Chrison.UnifiSharp.svg)](https://www.nuget.org/packages/Chrison.UnifiSharp/)
[![Downloads](https://img.shields.io/nuget/dt/Chrison.UnifiSharp.svg)](https://www.nuget.org/packages/Chrison.UnifiSharp/)
[![ci](https://github.com/Chrison-dev/UnifiSharp/actions/workflows/ci.yml/badge.svg)](https://github.com/Chrison-dev/UnifiSharp/actions/workflows/ci.yml)
[![Built with Fallout](https://img.shields.io/badge/built%20with-Fallout-8A2BE2)](https://github.com/Fallout-build/Fallout)
[![License: MIT](https://img.shields.io/github/license/Chrison-dev/UnifiSharp.svg)](LICENSE)

A C# client for the **UniFi Network API** — **mostly code-generated** from
Ubiquiti's official OpenAPI spec, with a thin hand-written runtime for auth and
transport. Sibling to [ProxmoxSharp](https://github.com/Chrison-dev/ProxmoxSharp);
built to bring the UniFi-managed network under the homelab's C#-native IaC. See
[ADR-0003](https://github.com/Chrison-dev/Homelab/blob/main/docs/adr/ADR-0003-unifisharp.md).
[ADR-0003](https://github.com/Chrison-Homelab/Homelab/blob/main/docs/adr/ADR-0003-unifisharp.md).

```sh
dotnet add package Chrison.UnifiSharp
```

## Approach

```
UniFi Network OpenAPI spec (console Settings → Integrations / beezly mirror)
│ Kiota (pinned dotnet tool) → generated C# client (UnifiSharp.Api)
UnifiSharp = hand-written runtime over it (X-API-KEY auth)
```mermaid
flowchart LR
SPEC["📜 UniFi OpenAPI 3.1<br/>(console / beezly mirror)"] --> KIOTA["⚙️ Kiota (pinned tool)<br/>generate C# client"]
KIOTA --> API["📦 UnifiSharp.Api<br/>generated · tracks UniFi release"]
API --> RT["✍️ UnifiSharp<br/>hand-written runtime (X-API-KEY)"]
RT --> LEG["🧩 UnifiSharp.Legacy<br/>session-auth write adapter<br/>(port-forwards · firewall · networks)"]
classDef gen fill:#e0e7ff,stroke:#4f46e5;
class API gen;
```

The UniFi spec is already OpenAPI 3.1, so — unlike ProxmoxSharp — there's **no
Expand Down
2 changes: 1 addition & 1 deletion src/UnifiSharp/UnifiSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<!-- Independent SemVer for the hand-written surface; decoupled from the
UniFi API version (UnifiSharp.Api). -->
<VersionPrefix>0.1.0</VersionPrefix>
<VersionPrefix>0.1.1</VersionPrefix>
<!-- Public nuget.org ID uses the reserved Chrison.* prefix (the bare
'UnifiSharp' ID is taken on nuget.org by an unrelated project).
AssemblyName/RootNamespace stay 'UnifiSharp' (project name) so consumer
Expand Down
Loading