Winche.Core 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Winche.Core --version 1.0.0
                    
NuGet\Install-Package Winche.Core -Version 1.0.0
                    
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="Winche.Core" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Winche.Core" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Winche.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Winche.Core --version 1.0.0
                    
#r "nuget: Winche.Core, 1.0.0"
                    
#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.
#:package Winche.Core@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Winche.Core&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Winche.Core&version=1.0.0
                    
Install as a Cake Tool

Winche.Core

What every Winche package shares: settings the console (or the CLI, or your own tools) can change while the app runs, secrets, the error every Winche API answers with, and the values documents hold.

Value types

Each type has one name, written out in full, and every place derives from it: the wire key (<name>Value), the class in C# and Dart (<Name>Value), the type in rules (x is <name>) and the console's label.

Name Wire Class Holds
null {"nullValue": null} NullValue nothing
boolean {"booleanValue": true} BooleanValue true or false
integer {"integerValue": "42"} IntegerValue a 64-bit whole number (a string on the wire, so no digits are lost)
double {"doubleValue": 4.5} DoubleValue a 64-bit floating-point number
timestamp {"timestampValue": "2026-11-15T10:00:00Z"} TimestampValue a moment, to the microsecond
string {"stringValue": "Ann"} StringValue text
bytes {"bytesValue": "AQID"} BytesValue binary data (base64)
documentReference {"documentReferenceValue": "users/u1"} DocumentReferenceValue a document, by its path
fileReference {"fileReferenceValue": "scans/a.png"} FileReferenceValue a file in Winche Storage, by its path
userReference {"userReferenceValue": "u1"} UserReferenceValue a Winche Auth user, by uid
geoPoint {"geoPointValue": {"latitude": 51.5, "longitude": -0.12}} GeoPointValue a place
array {"arrayValue": {"values": [ … ]}} ArrayValue an ordered list of values
map {"mapValue": {"fields": { … }}} MapValue named values

Rules also have number (an integer or a double). A path built in a rule, such as /users/$(id) or path('users', id), is a documentReference. Values of different types sort in the order of the table (numbers together), the same in queries, indexes and rules.

Errors

WincheError is the body of every failed Winche request — { "error": { "code", "message", "reason"?, "details"? } } — and WincheErrorCode the one list of codes (not-found, permission-denied, unauthenticated, …), each with one HTTP status (WincheError.StatusOf). reason is an API's own, more precise code where callers need it (INVALID_CREDENTIALS, invalid-query).

var error = new WincheError(WincheErrorCode.NotFound, "There's no file at a/b.");
return Results.Json(error.ToBody(), statusCode: error.HttpStatus);

Settings

The app's code gives each group of settings — an area — its starting values. A version saved in the store replaces them on every instance within seconds, keeps a complete history (who, when, why), can be restored, and can be reset to the code's values. Secrets (client secrets, storage keys, mail passwords) are kept encrypted with the project's master key and are never shown again. Everything lives in the project's own PostgreSQL database, so a self-hosted project carries its settings with it.

Each Winche package works without this one: without AddWincheConfig, its areas simply use the code's values.

builder.Services.AddWincheConfig(o =>
{
    o.ConnectionString = connectionString;
    o.MasterKey = builder.Configuration["Winche:MasterKey"];   // 32+ characters; needed only for secrets
});

// Packages register their areas (e.g. Winche.Auth's AddWincheTokens(t => t.UseSettings())); your own code can too:
var area = builder.Services.AddWincheSettingsArea("app.banner", "Banner", new Banner("Welcome"), b => b.Text.Length > 200 ? ["Too long."] : []);
// … later: area.Current, area.Changed += …
SettingsStore.SaveAsync(area, json, by, reason) checks the document against the area, saves a new version, applies it here at once
SaveAsync(area, json, by, reason, basedOn) the same, made from version basedOn (0: none saved yet): refused with SettingsConflictException (its Latest) when someone saved another since, so their change isn't undone
ResetAsync(area, …) back to the code's values (a version of its own, so it can be undone)
RestoreAsync(id, …) an earlier version again, as a new version
HistoryAsync(area?) every change, newest first
SecretStore.SetAsync / GetAsync / InfoAsync / DeleteAsync encrypted secrets (AES-256-GCM, bound to their name)

Tables: winche_settings, winche_secrets (made on start, with WincheSchema: each package's tables are made and upgraded in numbered steps under a lock, so many servers starting at once don't race). Other instances look for changes every PollInterval (5 seconds). A saved version the app can no longer read (its shape changed) is logged and skipped.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (10)

Showing the top 5 NuGet packages that depend on Winche.Core:

Package Downloads
Winche.Database

A JSON document database layer built on top of PostgreSQL. Store, query, and subscribe to JSON documents — with PostgreSQL as the storage backend via JSONB.

Winche.Storage

PostgreSQL-backed file metadata store with path-based access control, webhook hooks, and pluggable archive backends.

Winche.Rules

A declarative, JSON-serializable authorization rules engine. Write document access rules in a small rules language (or load them as JSON), evaluate them in memory, and analyze queries against them. Backend-agnostic via small adapter ports.

Winche.Core.AspNetCore

Winche.Core for ASP.NET Core: who is calling (the request's claims, set once for every Winche package), and the shared error answer and endpoint filter.

Winche.Functions

JavaScript and TypeScript functions for the Winche stack, run by Deno in sandboxed workers: on document, file and user changes, on a schedule, or called by apps. Written in the console or VS Code.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 138 11/17/2026
1.0.0 206 11/16/2026