diff --git a/.gitignore b/.gitignore
index c7ac18e..114d915 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,11 +1,14 @@
+.agents/
+.codex/
.vs/
bin/
+Binaries
+Intermediate/
obj/
-releases/*
-!releases/.gitkeep
.DS_Store
.env
*.filters
*.user
+*.lscache
desktop.ini
diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
index 7def927..7cb3a8d 100644
--- a/.openapi-generator/FILES
+++ b/.openapi-generator/FILES
@@ -16,7 +16,6 @@ src/Tribufu/Client/OpenAPIDateConverter.cs
src/Tribufu/Client/RequestOptions.cs
src/Tribufu/Client/RetryConfiguration.cs
src/Tribufu/Model/AbstractOpenAPISchema.cs
-src/Tribufu/Model/Account.cs
src/Tribufu/Model/Application.cs
src/Tribufu/Model/ApplicationType.cs
src/Tribufu/Model/AuthorizeRequest.cs
@@ -26,7 +25,7 @@ src/Tribufu/Model/CodeChallengeMethod.cs
src/Tribufu/Model/CodeResponse.cs
src/Tribufu/Model/CreateUser.cs
src/Tribufu/Model/CryptoViewModel.cs
-src/Tribufu/Model/File.cs
+src/Tribufu/Model/ExternalAccount.cs
src/Tribufu/Model/Game.cs
src/Tribufu/Model/GameServer.cs
src/Tribufu/Model/GameServerCluster.cs
@@ -34,19 +33,22 @@ src/Tribufu/Model/GameServerQuery.cs
src/Tribufu/Model/GameServerStatus.cs
src/Tribufu/Model/GrantType.cs
src/Tribufu/Model/Group.cs
-src/Tribufu/Model/GroupGame.cs
+src/Tribufu/Model/GroupApplication.cs
src/Tribufu/Model/GroupMember.cs
src/Tribufu/Model/GroupRank.cs
src/Tribufu/Model/HashViewModel.cs
+src/Tribufu/Model/IdentityProviderType.cs
src/Tribufu/Model/IntrospectRequest.cs
src/Tribufu/Model/IntrospectResponse.cs
src/Tribufu/Model/IpAddress.cs
src/Tribufu/Model/LeaderboardItem.cs
src/Tribufu/Model/LeaderboardOrder.cs
-src/Tribufu/Model/LoginProvider.cs
src/Tribufu/Model/ModelClient.cs
src/Tribufu/Model/Package.cs
src/Tribufu/Model/PackageRelease.cs
+src/Tribufu/Model/Product.cs
+src/Tribufu/Model/ProductPrice.cs
+src/Tribufu/Model/ProductType.cs
src/Tribufu/Model/Profile.cs
src/Tribufu/Model/ProfileGame.cs
src/Tribufu/Model/ProfileGroup.cs
@@ -55,8 +57,7 @@ src/Tribufu/Model/RevokeRequest.cs
src/Tribufu/Model/Search.cs
src/Tribufu/Model/SearchType.cs
src/Tribufu/Model/ServerMetrics.cs
-src/Tribufu/Model/Subscription.cs
-src/Tribufu/Model/SubscriptionPrice.cs
+src/Tribufu/Model/StorageFile.cs
src/Tribufu/Model/TokenHintType.cs
src/Tribufu/Model/TokenRequest.cs
src/Tribufu/Model/TokenResponse.cs
diff --git a/Directory.Build.props b/Directory.Build.props
index 96c42d7..5e893d6 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -5,9 +5,17 @@
Copyright (c) Tribufu. All Rights Reserved.
MIT
git
- https://github.com/tribufu/tribufu-dotnet
- 1.2.0
+ https://github.com/Tribufu/TribufuDotNet
+ 1.3.0
$(Version).0
$(NoWarn);0618;1591;1998;2002;8767
+
+ $(SolutionDir)Intermediate\DotNet\$(MSBuildProjectName)\
+ $(BaseIntermediateOutputPath)$(Configuration)\
+ $(BaseIntermediateOutputPath)
+ $(IntermediateOutputPath)
+ $(SolutionDir)Binaries\$(Configuration)\DotNet\
+ $(SolutionDir)Intermediate\
+
diff --git a/README.md b/README.md
index 1108fa0..a5bf230 100644
--- a/README.md
+++ b/README.md
@@ -6,10 +6,10 @@
[![MIT License][mit-badge]][mit-url]
[![Discord Chat][discord-badge]][discord-url]
-[nuget-badge]: https://img.shields.io/nuget/v/tribufu.svg
+[nuget-badge]: https://img.shields.io/nuget/v/Tribufu.svg
[nuget-url]: https://www.nuget.org/packages/Tribufu
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
-[mit-url]: https://github.com/tribufu/tribufu-dotnet/blob/main/LICENSE.txt
+[mit-url]: https://github.com/Tribufu/TribufuDotNet/blob/main/LICENSE.txt
[discord-badge]: https://img.shields.io/discord/276504514616623104.svg?logo=discord&style=flat-square
[discord-url]: https://www.tribufu.com/discord
@@ -20,4 +20,4 @@
This project is licensed under the [MIT License].
-[MIT License]: https://github.com/tribufu/tribufu-dotnet/blob/main/LICENSE.txt
+[MIT License]: https://github.com/Tribufu/TribufuDotNet/blob/main/LICENSE.txt
diff --git a/scripts/generate.ps1 b/Scripts/Generate.ps1
similarity index 58%
rename from scripts/generate.ps1
rename to Scripts/Generate.ps1
index 7f14cb8..abb11fc 100644
--- a/scripts/generate.ps1
+++ b/Scripts/Generate.ps1
@@ -1,5 +1,7 @@
#!/usr/bin/env pwsh
+$ErrorActionPreference = "Stop"
+
$env:CSHARP_POST_PROCESS_FILE = ""
java -jar ./vendor/openapi-generator/openapi-generator-cli.jar generate `
@@ -7,6 +9,15 @@ java -jar ./vendor/openapi-generator/openapi-generator-cli.jar generate `
-g csharp `
-o . `
--global-property apis,models,supportingFiles,apiDocs=false,modelDocs=false,apiTests=false,modelTests=false `
- --additional-properties=packageName=Tribufu,library=restsharp,zeroBasedEnums=true,nullableReferenceTypes=true `
+ --additional-properties=packageName=Tribufu,library=restsharp,targetFramework=net47,zeroBasedEnums=true `
--openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=TribufuGenerated `
--skip-validate-spec
+
+$srcDir = "./src"
+$sourceDir = "./Source"
+
+if (Test-Path $srcDir) {
+ New-Item -ItemType Directory -Force -Path $sourceDir | Out-Null
+ Copy-Item -Path (Join-Path $srcDir "*") -Destination $sourceDir -Recurse -Force
+ Remove-Item $srcDir -Recurse -Force
+}
diff --git a/Scripts/Package.ps1 b/Scripts/Package.ps1
new file mode 100644
index 0000000..658179e
--- /dev/null
+++ b/Scripts/Package.ps1
@@ -0,0 +1,7 @@
+#!/usr/bin/env pwsh
+
+Get-ChildItem ./Intermediate -Filter *.nupkg -Recurse -Force | Remove-Item -Force
+
+dotnet clean
+dotnet build -c Release
+dotnet pack -c Release -o ./Intermediate
diff --git a/src/Tribufu.AspNetCore/Extensions/HttpContextExtensions.cs b/Source/Tribufu.AspNetCore/Extensions/HttpContextExtensions.cs
similarity index 100%
rename from src/Tribufu.AspNetCore/Extensions/HttpContextExtensions.cs
rename to Source/Tribufu.AspNetCore/Extensions/HttpContextExtensions.cs
diff --git a/src/Tribufu.AspNetCore/README.md b/Source/Tribufu.AspNetCore/README.md
similarity index 100%
rename from src/Tribufu.AspNetCore/README.md
rename to Source/Tribufu.AspNetCore/README.md
diff --git a/src/Tribufu.AspNetCore/Tribufu.AspNetCore.csproj b/Source/Tribufu.AspNetCore/Tribufu.AspNetCore.csproj
similarity index 100%
rename from src/Tribufu.AspNetCore/Tribufu.AspNetCore.csproj
rename to Source/Tribufu.AspNetCore/Tribufu.AspNetCore.csproj
diff --git a/src/Tribufu.ComponentModel/EnumMemberConverter.cs b/Source/Tribufu.ComponentModel/EnumMemberConverter.cs
similarity index 100%
rename from src/Tribufu.ComponentModel/EnumMemberConverter.cs
rename to Source/Tribufu.ComponentModel/EnumMemberConverter.cs
diff --git a/src/Tribufu.ComponentModel/README.md b/Source/Tribufu.ComponentModel/README.md
similarity index 100%
rename from src/Tribufu.ComponentModel/README.md
rename to Source/Tribufu.ComponentModel/README.md
diff --git a/src/Tribufu.ComponentModel/Tribufu.ComponentModel.csproj b/Source/Tribufu.ComponentModel/Tribufu.ComponentModel.csproj
similarity index 100%
rename from src/Tribufu.ComponentModel/Tribufu.ComponentModel.csproj
rename to Source/Tribufu.ComponentModel/Tribufu.ComponentModel.csproj
diff --git a/src/Tribufu.Configuration/ConfigurationLoader.cs b/Source/Tribufu.Configuration/ConfigurationLoader.cs
similarity index 100%
rename from src/Tribufu.Configuration/ConfigurationLoader.cs
rename to Source/Tribufu.Configuration/ConfigurationLoader.cs
diff --git a/src/Tribufu.Configuration/Extensions/IConfigurationExtensions.cs b/Source/Tribufu.Configuration/Extensions/IConfigurationExtensions.cs
similarity index 100%
rename from src/Tribufu.Configuration/Extensions/IConfigurationExtensions.cs
rename to Source/Tribufu.Configuration/Extensions/IConfigurationExtensions.cs
diff --git a/src/Tribufu.Configuration/README.md b/Source/Tribufu.Configuration/README.md
similarity index 100%
rename from src/Tribufu.Configuration/README.md
rename to Source/Tribufu.Configuration/README.md
diff --git a/src/Tribufu.Configuration/Tribufu.Configuration.csproj b/Source/Tribufu.Configuration/Tribufu.Configuration.csproj
similarity index 100%
rename from src/Tribufu.Configuration/Tribufu.Configuration.csproj
rename to Source/Tribufu.Configuration/Tribufu.Configuration.csproj
diff --git a/src/Tribufu.EntityFrameworkCore/Repositories/IRepository.cs b/Source/Tribufu.EntityFrameworkCore/IRepository.cs
similarity index 64%
rename from src/Tribufu.EntityFrameworkCore/Repositories/IRepository.cs
rename to Source/Tribufu.EntityFrameworkCore/IRepository.cs
index dbb4b19..0e00b08 100644
--- a/src/Tribufu.EntityFrameworkCore/Repositories/IRepository.cs
+++ b/Source/Tribufu.EntityFrameworkCore/IRepository.cs
@@ -4,23 +4,25 @@
using System.Collections.Generic;
using System.Threading.Tasks;
-namespace Tribufu.EntityFrameworkCore.Repositories
+namespace Tribufu.EntityFrameworkCore
{
public interface IRepository where T : class
{
+ void Seed();
+
Task SeedAsync();
- IList GetAll();
+ IList List();
- Task> GetAllAsync();
+ Task> ListAsync();
- IList GetPage(uint page, uint limit);
+ IList List(uint page, uint limit);
- Task> GetPageAsync(uint page, uint limit);
+ Task> ListAsync(uint page, uint limit);
- T? GetOne(K key);
+ T? Find(K key);
- Task GetOneAsync(K key);
+ Task FindAsync(K key);
T? Create(T entity);
diff --git a/src/Tribufu.EntityFrameworkCore/README.md b/Source/Tribufu.EntityFrameworkCore/README.md
similarity index 100%
rename from src/Tribufu.EntityFrameworkCore/README.md
rename to Source/Tribufu.EntityFrameworkCore/README.md
diff --git a/src/Tribufu.EntityFrameworkCore/Repositories/Repository.cs b/Source/Tribufu.EntityFrameworkCore/Repository.cs
similarity index 70%
rename from src/Tribufu.EntityFrameworkCore/Repositories/Repository.cs
rename to Source/Tribufu.EntityFrameworkCore/Repository.cs
index c70a3c5..6851858 100644
--- a/src/Tribufu.EntityFrameworkCore/Repositories/Repository.cs
+++ b/Source/Tribufu.EntityFrameworkCore/Repository.cs
@@ -7,50 +7,54 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-namespace Tribufu.EntityFrameworkCore.Repositories
+namespace Tribufu.EntityFrameworkCore
{
public class Repository : IRepository where C : DbContext where T : class
{
- protected readonly C _context;
+ protected readonly C _dbContext;
protected readonly DbSet _dbSet;
- public Repository(C context)
+ public Repository(C dbContext)
+ {
+ _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
+ _dbSet = dbContext.Set();
+ }
+
+ public virtual void Seed()
{
- _context = context ?? throw new ArgumentNullException(nameof(context));
- _dbSet = context.Set();
}
public virtual async Task SeedAsync()
{
}
- public virtual IList GetAll()
+ public virtual IList List()
{
return [.. _dbSet];
}
- public virtual async Task> GetAllAsync()
+ public virtual async Task> ListAsync()
{
return await _dbSet.ToListAsync();
}
- public virtual IList GetPage(uint page, uint limit)
+ public virtual IList List(uint page, uint limit)
{
return _dbSet.Skip((int)((page < 1 ? 0 : page - 1) * limit)).Take((int)limit).ToList();
}
- public virtual async Task> GetPageAsync(uint page, uint limit)
+ public virtual async Task> ListAsync(uint page, uint limit)
{
return await _dbSet.Skip((int)((page < 1 ? 0 : page - 1) * limit)).Take((int)limit).ToListAsync();
}
- public virtual T? GetOne(K key)
+ public virtual T? Find(K key)
{
return _dbSet.Find(key);
}
- public virtual async Task GetOneAsync(K key)
+ public virtual async Task FindAsync(K key)
{
return await _dbSet.FindAsync(key);
}
@@ -58,29 +62,28 @@ namespace Tribufu.EntityFrameworkCore.Repositories
public virtual T? Create(T entity)
{
_dbSet.Add(entity);
-
- var result = _context.SaveChanges();
+ var result = _dbContext.SaveChanges();
return result > 0 ? entity : null;
}
public virtual async Task CreateAsync(T entity)
{
await _dbSet.AddAsync(entity);
- var result = await _context.SaveChangesAsync();
+ var result = await _dbContext.SaveChangesAsync();
return result > 0 ? entity : null;
}
public virtual T? Update(T entity)
{
_dbSet.Update(entity);
- var result = _context.SaveChanges();
+ var result = _dbContext.SaveChanges();
return result > 0 ? entity : null;
}
public virtual async Task UpdateAsync(T entity)
{
_dbSet.Update(entity);
- var result = await _context.SaveChangesAsync();
+ var result = await _dbContext.SaveChangesAsync();
return result > 0 ? entity : null;
}
@@ -105,13 +108,13 @@ namespace Tribufu.EntityFrameworkCore.Repositories
public virtual void Delete(T entity)
{
_dbSet.Remove(entity);
- _context.SaveChanges();
+ _dbContext.SaveChanges();
}
public virtual async Task DeleteAsync(T entity)
{
_dbSet.Remove(entity);
- await _context.SaveChangesAsync();
+ await _dbContext.SaveChangesAsync();
}
}
}
diff --git a/src/Tribufu.EntityFrameworkCore/Tribufu.EntityFrameworkCore.csproj b/Source/Tribufu.EntityFrameworkCore/Tribufu.EntityFrameworkCore.csproj
similarity index 100%
rename from src/Tribufu.EntityFrameworkCore/Tribufu.EntityFrameworkCore.csproj
rename to Source/Tribufu.EntityFrameworkCore/Tribufu.EntityFrameworkCore.csproj
diff --git a/src/Tribufu.Example/Program.cs b/Source/Tribufu.Example/Program.cs
similarity index 100%
rename from src/Tribufu.Example/Program.cs
rename to Source/Tribufu.Example/Program.cs
diff --git a/src/Tribufu.Example/Tribufu.Example.csproj b/Source/Tribufu.Example/Tribufu.Example.csproj
similarity index 100%
rename from src/Tribufu.Example/Tribufu.Example.csproj
rename to Source/Tribufu.Example/Tribufu.Example.csproj
diff --git a/src/Tribufu.Logging/LogLevel.cs b/Source/Tribufu.Logging/LogLevel.cs
similarity index 100%
rename from src/Tribufu.Logging/LogLevel.cs
rename to Source/Tribufu.Logging/LogLevel.cs
diff --git a/src/Tribufu.Logging/Logger.cs b/Source/Tribufu.Logging/Logger.cs
similarity index 100%
rename from src/Tribufu.Logging/Logger.cs
rename to Source/Tribufu.Logging/Logger.cs
diff --git a/src/Tribufu.Logging/README.md b/Source/Tribufu.Logging/README.md
similarity index 100%
rename from src/Tribufu.Logging/README.md
rename to Source/Tribufu.Logging/README.md
diff --git a/src/Tribufu.Logging/Tribufu.Logging.csproj b/Source/Tribufu.Logging/Tribufu.Logging.csproj
similarity index 100%
rename from src/Tribufu.Logging/Tribufu.Logging.csproj
rename to Source/Tribufu.Logging/Tribufu.Logging.csproj
diff --git a/src/Tribufu.Platform/FlakeGenerator.cs b/Source/Tribufu.Platform/FlakeGenerator.cs
similarity index 100%
rename from src/Tribufu.Platform/FlakeGenerator.cs
rename to Source/Tribufu.Platform/FlakeGenerator.cs
diff --git a/src/Tribufu.Platform/Paths.cs b/Source/Tribufu.Platform/Paths.cs
similarity index 100%
rename from src/Tribufu.Platform/Paths.cs
rename to Source/Tribufu.Platform/Paths.cs
diff --git a/src/Tribufu.Platform/README.md b/Source/Tribufu.Platform/README.md
similarity index 100%
rename from src/Tribufu.Platform/README.md
rename to Source/Tribufu.Platform/README.md
diff --git a/src/Tribufu.Platform/Tribufu.Platform.csproj b/Source/Tribufu.Platform/Tribufu.Platform.csproj
similarity index 100%
rename from src/Tribufu.Platform/Tribufu.Platform.csproj
rename to Source/Tribufu.Platform/Tribufu.Platform.csproj
diff --git a/src/Tribufu.Serialization/BaseClassFirstContractResolver.cs b/Source/Tribufu.Serialization/BaseClassFirstContractResolver.cs
similarity index 100%
rename from src/Tribufu.Serialization/BaseClassFirstContractResolver.cs
rename to Source/Tribufu.Serialization/BaseClassFirstContractResolver.cs
diff --git a/src/Tribufu.Serialization/CustomSerializerSettings.cs b/Source/Tribufu.Serialization/CustomSerializerSettings.cs
similarity index 100%
rename from src/Tribufu.Serialization/CustomSerializerSettings.cs
rename to Source/Tribufu.Serialization/CustomSerializerSettings.cs
diff --git a/src/Tribufu.Serialization/DecimalNullableStringConverter.cs b/Source/Tribufu.Serialization/DecimalNullableStringConverter.cs
similarity index 100%
rename from src/Tribufu.Serialization/DecimalNullableStringConverter.cs
rename to Source/Tribufu.Serialization/DecimalNullableStringConverter.cs
diff --git a/src/Tribufu.Serialization/DecimalStringConverter.cs b/Source/Tribufu.Serialization/DecimalStringConverter.cs
similarity index 100%
rename from src/Tribufu.Serialization/DecimalStringConverter.cs
rename to Source/Tribufu.Serialization/DecimalStringConverter.cs
diff --git a/src/Tribufu.Serialization/NetworkAwareSnakeCaseNamingStrategy.cs b/Source/Tribufu.Serialization/NetworkAwareSnakeCaseNamingStrategy.cs
similarity index 100%
rename from src/Tribufu.Serialization/NetworkAwareSnakeCaseNamingStrategy.cs
rename to Source/Tribufu.Serialization/NetworkAwareSnakeCaseNamingStrategy.cs
diff --git a/src/Tribufu.Serialization/README.md b/Source/Tribufu.Serialization/README.md
similarity index 100%
rename from src/Tribufu.Serialization/README.md
rename to Source/Tribufu.Serialization/README.md
diff --git a/src/Tribufu.Serialization/Tribufu.Serialization.csproj b/Source/Tribufu.Serialization/Tribufu.Serialization.csproj
similarity index 100%
rename from src/Tribufu.Serialization/Tribufu.Serialization.csproj
rename to Source/Tribufu.Serialization/Tribufu.Serialization.csproj
diff --git a/src/Tribufu.Serialization/ULongNullableStringConverter.cs b/Source/Tribufu.Serialization/ULongNullableStringConverter.cs
similarity index 100%
rename from src/Tribufu.Serialization/ULongNullableStringConverter.cs
rename to Source/Tribufu.Serialization/ULongNullableStringConverter.cs
diff --git a/src/Tribufu.Serialization/ULongStringConverter.cs b/Source/Tribufu.Serialization/ULongStringConverter.cs
similarity index 100%
rename from src/Tribufu.Serialization/ULongStringConverter.cs
rename to Source/Tribufu.Serialization/ULongStringConverter.cs
diff --git a/src/Tribufu/Api/TribufuGeneratedApi.cs b/Source/Tribufu/Api/TribufuGeneratedApi.cs
similarity index 88%
rename from src/Tribufu/Api/TribufuGeneratedApi.cs
rename to Source/Tribufu/Api/TribufuGeneratedApi.cs
index c861352..096ce48 100644
--- a/src/Tribufu/Api/TribufuGeneratedApi.cs
+++ b/Source/Tribufu/Api/TribufuGeneratedApi.cs
@@ -3,7 +3,7 @@
*
* API to access Tribufu services.
*
- * The version of the OpenAPI document: 1.2.6
+ * The version of the OpenAPI document: 1.4.3
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
@@ -37,7 +37,7 @@ namespace Tribufu.Api
/// (optional)
/// Index associated with the operation.
/// CodeResponse
- CodeResponse Authorize(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0);
+ CodeResponse Authorize(AuthorizeRequest authorizeRequest = default(AuthorizeRequest), int operationIndex = 0);
///
/// Authorize the client to access the user information.
@@ -49,7 +49,7 @@ namespace Tribufu.Api
/// (optional)
/// Index associated with the operation.
/// ApiResponse of CodeResponse
- ApiResponse AuthorizeWithHttpInfo(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0);
+ ApiResponse AuthorizeWithHttpInfo(AuthorizeRequest authorizeRequest = default(AuthorizeRequest), int operationIndex = 0);
///
/// Change the email of a user.
///
@@ -61,7 +61,7 @@ namespace Tribufu.Api
/// (optional)
/// Index associated with the operation.
///
- void ChangeEmail(string id, Object? body = default(Object?), int operationIndex = 0);
+ void ChangeEmail(string id, Object body = default(Object), int operationIndex = 0);
///
/// Change the email of a user.
@@ -74,7 +74,7 @@ namespace Tribufu.Api
/// (optional)
/// Index associated with the operation.
/// ApiResponse of Object(void)
- ApiResponse