Add shared packages

This commit is contained in:
2025-06-02 08:58:34 -03:00
parent 6ebfde013a
commit 5b2588b47f
32 changed files with 981 additions and 7 deletions

View File

@ -1,8 +1,9 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
using dotenv.net;
using Tribufu.Generated.Client;
using Tribufu.Logging;
namespace Tribufu.Test
{
@ -10,21 +11,23 @@ namespace Tribufu.Test
{
public static async Task Main(string[] args)
{
Logger.Initialize(LogLevel.All);
DotEnv.Load(new DotEnvOptions(ignoreExceptions: true, envFilePaths: [".env", "../../.env"]));
var apiKey = Environment.GetEnvironmentVariable("TRIBUFU_API_KEY");
var tribufu = new TribufuApi(apiKey ?? "");
Console.WriteLine(TribufuApi.GetVersion());
Logger.Debug(TribufuApi.GetVersion());
try
{
var result = await tribufu.GetUserInfoAsync();
Console.WriteLine(result);
Logger.Debug(result.ToString());
}
catch (ApiException e)
{
Console.WriteLine(e.Message);
Logger.Debug(e.Message);
}
}
}