Pronoza.Hub.Client 0.1.0-rc.2
Pronoza.Hub.Client
Client .NET typé pour l'API Pronoza.Hub (api-sport.smart-pronostics.com).
Couvre les routes publiques /api/v1/* :
| Route | Méthode | Description |
|---|---|---|
/api/v1/mapped-tips |
GET |
Pronostics mappés (filtres date/source/search) |
/api/v1/fixture-details |
POST |
Détails de fixtures + tips mappés (refresh conditionnel) |
/api/v1/matches/search |
GET |
Recherche multi-sport par mot-clé |
Authentification : header X-API-Key.
Installation
Le package est publié sur le feed privé https://nuget.smart-pronostics.com. Ajoute-le à ton nuget.config :
<packageSources>
<add key="smart-pronostics" value="https://nuget.smart-pronostics.com/v3/index.json" />
</packageSources>
Puis :
dotnet add package Pronoza.Hub.Client
Utilisation
Dans Program.cs :
using Pronoza.Hub.Client;
builder.Services.AddPronozaHubClient(opts =>
{
opts.BaseAddress = "https://api-sport.smart-pronostics.com";
opts.ApiKey = builder.Configuration["PronozaHub:ApiKey"]!;
});
Puis injecte la façade ou un sous-client :
public class MyService(IPronozaHubClient hub)
{
public async Task<IReadOnlyList<MappedTipDto>> GetTodayTipsAsync(CancellationToken ct)
=> await hub.MappedTips.GetAsync(date: DateTime.UtcNow.Date, ct: ct);
}
Sous-clients disponibles :
IPronozaHubClient.MappedTips→IMappedTipsClientIPronozaHubClient.FixtureDetails→IFixtureDetailsClientIPronozaHubClient.Matches→IMatchesClient
Résilience
Pipeline Polly intégré (Microsoft.Extensions.Http.Resilience) :
- Retry : 3 tentatives, exponential backoff + jitter
- Circuit breaker : ouverture à 50% d'échecs sur ≥5 requêtes, break 30s
- Timeout : 15s par requête (configurable via
Options.Timeout)
Versioning
SemVer par tag Git client-vX.Y.Z :
client-v0.1.0→ première release publique- Breaking change → bump major
- Nouveau endpoint → bump minor
- Fix → bump patch
Roadmap
- v0.1 : routes v1 ApiKey (actuel)
- v0.2 : authentification Bearer JWT
- v0.3 : génération auto via NSwag/Kiota (à arbitrer)
No packages depend on Pronoza.Hub.Client.
.NET 9.0
- Pronoza.Hub.Orchestration.Contracts (>= 0.1.0-rc.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.1)
- Microsoft.Extensions.Http (>= 9.0.12)
- Microsoft.Extensions.Http.Resilience (>= 10.2.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.1)
- Microsoft.Extensions.Options (>= 9.0.12)
| Version | Downloads | Last updated |
|---|---|---|
| 0.1.0 | 14 | 04/28/2026 |
| 0.1.0-rc.2 | 2 | 04/28/2026 |