![]() |
VOOZH | about |
dotnet add package Rudi.Dev.FastEndpoints.TsClientGenerator --version 0.1.0
NuGet\Install-Package Rudi.Dev.FastEndpoints.TsClientGenerator -Version 0.1.0
<PackageReference Include="Rudi.Dev.FastEndpoints.TsClientGenerator" Version="0.1.0" />
<PackageVersion Include="Rudi.Dev.FastEndpoints.TsClientGenerator" Version="0.1.0" />Directory.Packages.props
<PackageReference Include="Rudi.Dev.FastEndpoints.TsClientGenerator" />Project file
paket add Rudi.Dev.FastEndpoints.TsClientGenerator --version 0.1.0
#r "nuget: Rudi.Dev.FastEndpoints.TsClientGenerator, 0.1.0"
#:package Rudi.Dev.FastEndpoints.TsClientGenerator@0.1.0
#addin nuget:?package=Rudi.Dev.FastEndpoints.TsClientGenerator&version=0.1.0Install as a Cake Addin
#tool nuget:?package=Rudi.Dev.FastEndpoints.TsClientGenerator&version=0.1.0Install as a Cake Tool
A library that generates simple TypeScript clients for FastEndpoints projects.
No. This is relatively opinionated and expects the following:
Add Rudi.Dev.FastEndpoints.TsClientGenerator from NuGet.
After .UseFastEndpoints(..), add the following:
await app.UseTsClientGenerator(o =>
{
o.ApiClientOptions.BaseUrl = "https://localhost:7777";
o.ApiClientOptions.ClassName = "MyApi";
o.ApiClientOptions.Extends = "MyApiBase";
o.ApiClientOptions.ExtendsImportPath = "$lib/api/MyApiBase";
o.ApiClientOptions.ExtendsRequestInitMethod = "addHeaders";
o.ApiClientOptions.ExportInstance = true;
})
.GenerateAndWriteToFile("/path/to/apiclient.ts");
If you want to change the templates for a method, check them out first in /Templates. Then, you override with:
o.TemplateOverrides.AddOverride(TemplateType.ClassBase, myTemplate);
It's important to note that, as it stands, this was written for our own development purposes. It doesn't support everything.
That said, I'd love for it to be able to. If there's any requests, or it doesn't work in your project - submit an issue and repro (or suggested API). Or if you're that way inclined, a PR! 🥳
This is what's here (✅ or partially 😳), what's planned but not here yet (❌), and what probably should be here but just no (🤮):
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 435 | 11/7/2023 |