ATK.Command.Explorer 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ATK.Command.Explorer --version 0.1.0
                    
NuGet\Install-Package ATK.Command.Explorer -Version 0.1.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="ATK.Command.Explorer" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ATK.Command.Explorer" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ATK.Command.Explorer" />
                    
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 ATK.Command.Explorer --version 0.1.0
                    
#r "nuget: ATK.Command.Explorer, 0.1.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 ATK.Command.Explorer@0.1.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=ATK.Command.Explorer&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ATK.Command.Explorer&version=0.1.0
                    
Install as a Cake Tool

ATK.Command.Explorer

Swashbuckle-Pendant für command-basierte ASP.NET-Core-APIs.

Statt REST-Endpunkte zu beschreiben, dokumentiert der Explorer Commands: Beschreibung, Properties, Autorisierung und JSON-Schema – abrufbar über HTTP und nutzbar über eine mitgelieferte Angular-UI.

Was es liefert

Endpunkt Inhalt
GET /commands/explorer alle Commands als CommandDescriptor[]
GET /commands/explorer/tree Namespace-Hierarchie
GET /commands/explorer/{name} ein Command oder 404
GET /commands/explorer/documentation/vault Obsidian-Vault als ZIP
GET /commands/explorer/documentation/markdown eine Markdown-Datei
GET /commands/explorer/documentation/pdf PDF-Referenz
GET /commands/explorer/typescript TypeScript-Typen als ZIP
GET /commands/explorer/framework?framework=angular Angular-Gerüst als ZIP

Alle Dokumentations-Endpunkte akzeptieren ?scope= (Namespace oder Command-Name). Ohne scope wird alles exportiert, bei unbekanntem Wert antwortet die API mit 404.

Installation

dotnet add package ATK.Command.Explorer
builder.Services.Configure<CommandExplorerOptions>(
    builder.Configuration.GetSection(CommandExplorerOptions.SectionName));
builder.Services.AddCommandExplorer<MyApiMarker, IRequestCommand>();

TMarker liefert die Assembly, TCommand das Marker-Interface. Das Paket kennt weder IRequestCommand noch einen Anwendungstyp.

Alternativ ohne Marker-Typen:

builder.Services.AddCommandExplorer(
    typeof(Program).Assembly,
    typeof(IRequestCommand),
    options => options.NamespacePrefixes.Add("MyCompany.MyProduct"));

Voraussetzungen

  • .NET 10
  • Commands implementieren ein Marker-Interface (z. B. IRequestCommand)
  • SuppressModelStateInvalidFilter = true, damit 401 statt 400 zurückkommt:
builder.Services.Configure<ApiBehaviorOptions>(
    o => o.SuppressModelStateInvalidFilter = true);

Optionen

Abschnitt CommandExplorer in appsettings.json:

Option Standard Zweck
NamespacePrefixes leer Prefixe, die im Baum abgeschnitten werden
RoutePrefix commands/explorer Basisroute (derzeit fest im [Route]-Attribut)
AllowAnonymous true Endpunkte ohne Anmeldung erreichbar
Roles leer ODER-Verknüpfung, eine Rolle genügt
Policies leer UND-Verknüpfung, alle müssen greifen
Claims leer UND-Verknüpfung; Values intern ODER
AuthenticationSchemes leer Schemata für die Challenge
ServeUi false mitgelieferte UI ausliefern
UiPath commands/explorer-ui Pfad der UI
DocumentationTitle Command-Referenz Titel der Doku + Dateiname
FontDirectory leer .ttf-Ordner für PDF

Eingebettete UI

app.UseCommandExplorerUi();   // vor MapControllers

Die Angular-UI liegt als EmbeddedResource in der Assembly. UiPath darf nicht unter RoutePrefix liegen, sonst interpretiert der Controller den UI-Pfad als Command-Namen.

Autorisierung des Explorers

Attribute können keine Konfigurationswerte aufnehmen, deshalb setzt eine IControllerModelConvention zur Laufzeit AllowAnonymousFilter oder AuthorizeFilter.

CommandExplorerOptions → CommandExplorerPolicyBuilder → AuthorizationPolicy
                       → CommandExplorerAuthorizationConvention → Filter am Controller

Ohne konfiguriertes Authentifizierungsschema wirft die Konvention beim Start eine InvalidOperationException mit Handlungsanweisung – sonst gäbe es zur Laufzeit 500.

JSON-Schema

CommandDescriptor.JsonSchema und ResultJsonSchema folgen Draft 2020-12:

  • $type immer in required, mit const auf den Typnamen
  • required = alle nicht-nullable Wertetypen
  • additionalProperties: false
  • Enum → type: integer, enum: [...], x-enumNames: {...}

Die strukturelle Prüfung übernimmt das Schema. Commands selbst validieren über FluentValidation, nicht über DataAnnotations.

Build

dotnet build
dotnet pack -c Release -o artifacts

Beim Packen wird die Angular-UI automatisch gebaut, sofern ../ATK.Command.Ui/node_modules existiert. Fehlt es, wird ohne UI gepackt (Paket ~26 KB statt ~323 KB) und eine Warnung ausgegeben.

Property Wirkung
-p:BuildExplorerUiOnBuild=true UI auch beim normalen Build bauen
-p:SkipExplorerUiBuild=true kein UI-Build

Abhängigkeiten

Paket Version Anmerkung
ATK.Command.AspNet.ModelBinder 0.0.5
ATK.Command.CsToTsGenerator 1.1.9 TypeScript-Export
Cortex.Mediator 3.1.2
PDFsharp 6.2.4 letzte MIT-Version – nicht aktualisieren
System.Security.Cryptography.Pkcs 10.0.14 gepinnt wegen NU1902/NU1903

PDFsharp ab 6.5.0 steht unter AGPL-3.0-only und verlangt zusätzlich einen Lizenzschlüssel zur Laufzeit. Für ein weitergegebenes NuGet-Paket nicht tragbar.

Lizenz

MIT – siehe LICENSE.

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

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.3.0 80 11/14/2026
0.1.3 86 11/8/2026
0.1.0 76 11/8/2026