Skip to content

Commit

Permalink
v1.9.0 (#17)
Browse files Browse the repository at this point in the history
* v1.9.0

* Update global.json

* Update nuke

---------

Co-authored-by: JT <[email protected]>
  • Loading branch information
Hawxy and Hawxy authored Jan 4, 2025
1 parent 47ac10f commit 7d209e7
Show file tree
Hide file tree
Showing 46 changed files with 782 additions and 140 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/Build_&_Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ jobs:
name: ubuntu-latest
runs-on: ubuntu-latest
steps:
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
.nuke/temp
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/Manual_Nuget_Push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ jobs:
name: ubuntu-latest
runs-on: ubuntu-latest
steps:
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
.nuke/temp
Expand Down
4 changes: 2 additions & 2 deletions Package.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>
<PropertyGroup>
<Version>1.8.0</Version>
<Version>1.9.0</Version>
<Authors>Hawxy</Authors>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Hawxy/Clerk.Net</PackageProjectUrl>
<RepositoryUrl>https://github.com/Hawxy/Clerk.Net</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Copyright>Hawxy 2023-2024</Copyright>
<Copyright>Hawxy 2023-2025</Copyright>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>
Expand Down
4 changes: 2 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ $DotNetGlobalFile = "$PSScriptRoot\\global.json"
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
$DotNetChannel = "STS"

$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
$env:DOTNET_MULTILEVEL_LOOKUP = 0
$env:DOTNET_NOLOGO = 1

###########################################################################
# EXECUTION
Expand Down Expand Up @@ -61,6 +60,7 @@ else {
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
}
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
$env:PATH = "$DotNetDirectory;$env:PATH"
}

Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
DOTNET_CHANNEL="STS"

export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_MULTILEVEL_LOOKUP=0
export DOTNET_NOLOGO=1

###########################################################################
# EXECUTION
Expand Down Expand Up @@ -54,6 +53,7 @@ else
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
fi
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
export PATH="$DOTNET_DIRECTORY:$PATH"
fi

echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"
Expand Down
14 changes: 6 additions & 8 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@
[GitHubActions(
"Build & Test",
GitHubActionsImage.UbuntuLatest,
OnPushBranches = new []{ "main" },
OnPullRequestBranches = new []{ "main" },
InvokedTargets = new[] { nameof(Test) },
AutoGenerate = false)]
OnPushBranches = ["main"],
OnPullRequestBranches = ["main"],
InvokedTargets = [nameof(Test)])]
[GitHubActions(
"Manual Nuget Push",
GitHubActionsImage.UbuntuLatest,
On = new[] { GitHubActionsTrigger.WorkflowDispatch },
InvokedTargets = new[] { nameof(NugetPush) },
ImportSecrets = new[] { nameof(NugetApiKey) },
AutoGenerate = false)]
On = [GitHubActionsTrigger.WorkflowDispatch],
InvokedTargets = [nameof(NugetPush)],
ImportSecrets = [nameof(NugetApiKey)])]
class Build : NukeBuild
{
/// Support plugins are available for:
Expand Down
8 changes: 4 additions & 4 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
Expand All @@ -12,9 +12,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Playwright" Version="1.47.0" />
<PackageReference Include="Nuke.Common" Version="8.1.0" />
<PackageDownload Include="Microsoft.OpenApi.Kiota" Version="[1.20.0]" />
<PackageReference Include="Microsoft.Playwright" Version="1.49.0" />
<PackageReference Include="Nuke.Common" Version="9.0.3" />
<PackageDownload Include="Microsoft.OpenApi.Kiota" Version="[1.21.0]" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "9.0.101",
"rollForward": "latestMajor"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PackageId>Clerk.Net.DependencyInjection</PackageId>
<Description>Clerk Backend API Wrapper for .NET. This package includes dependency injection extensions.</Description>
<PackageTags>clerk,auth</PackageTags>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -17,6 +17,10 @@
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Clerk.Net\Clerk.Net.csproj" />
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/Clerk.Net.JwtSample/Clerk.Net.JwtSample.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
</ItemGroup>

</Project>
14 changes: 5 additions & 9 deletions src/Clerk.Net.Tests/Clerk.Net.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit.v3" Version="1.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
9 changes: 2 additions & 7 deletions src/Clerk.Net/Clerk.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@
<PackageId>Clerk.Net</PackageId>
<Description>Clerk Backend API Wrapper for .NET. This package includes the OpenAPI-generated client.</Description>
<PackageTags>clerk,auth</PackageTags>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Bundle" Version="1.15.2" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Clerk.Net/ClerkApiClientFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class ClerkApiClientFactory
/// <param name="secretKey">The Secret Key from your Clerk instance.</param>
/// <param name="httpClient">An optional <see cref="HttpClient"/> for advanced use.</param>
/// <returns>The <see cref="ClerkApiClient"/></returns>
public static ClerkApiClient Create(string secretKey, HttpClient? httpClient = default)
public static ClerkApiClient Create(string secretKey, HttpClient? httpClient = null)
{
if (string.IsNullOrEmpty(secretKey))
throw new ArgumentNullException(nameof(secretKey));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public Organization_settingsRequestBuilder(string rawUrl, IRequestAdapter reques
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
/// <exception cref="global::Clerk.Net.Client.Models.ClerkErrors">When receiving a 400 status code</exception>
/// <exception cref="global::Clerk.Net.Client.Models.ClerkErrors">When receiving a 402 status code</exception>
/// <exception cref="global::Clerk.Net.Client.Models.ClerkErrors">When receiving a 404 status code</exception>
/// <exception cref="global::Clerk.Net.Client.Models.ClerkErrors">When receiving a 422 status code</exception>
Expand All @@ -56,6 +57,7 @@ public Organization_settingsRequestBuilder(string rawUrl, IRequestAdapter reques
var requestInfo = ToPatchRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{ "400", global::Clerk.Net.Client.Models.ClerkErrors.CreateFromDiscriminatorValue },
{ "402", global::Clerk.Net.Client.Models.ClerkErrors.CreateFromDiscriminatorValue },
{ "404", global::Clerk.Net.Client.Models.ClerkErrors.CreateFromDiscriminatorValue },
{ "422", global::Clerk.Net.Client.Models.ClerkErrors.CreateFromDiscriminatorValue },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public partial class InvitationsPostRequestBody : IParsable
public int? ExpiresInDays { get; set; }
/// <summary>Whether an invitation should be created if there is already an existing invitation for this email address, or it&apos;s claimed by another user.</summary>
public bool? IgnoreExisting { get; set; }
/// <summary>Optional flag which denotes whether an email invitation should be sent to the given email address.Defaults to true.</summary>
/// <summary>Optional flag which denotes whether an email invitation should be sent to the given email address.Defaults to `true`.</summary>
public bool? Notify { get; set; }
/// <summary>Metadata that will be attached to the newly created invitation.The value of this property should be a well-formed JSON object.Once the user accepts the invitation and signs up, these metadata will end up in the user&apos;s public metadata.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand Down
28 changes: 16 additions & 12 deletions src/Clerk.Net/Client/Models/EmailAddress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public partial class EmailAddress : IParsable
#else
public List<global::Clerk.Net.Client.Models.IdentificationLink> LinkedTo { get; set; }
#endif
/// <summary>Indicates whether this email address domain matches an active enterprise connection.</summary>
public bool? MatchesSsoConnection { get; set; }
/// <summary>String representing the object&apos;s type. Objects of the same type share the same value.</summary>
public global::Clerk.Net.Client.Models.EmailAddress_object? Object { get; set; }
/// <summary>The reserved property</summary>
Expand Down Expand Up @@ -74,6 +76,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{ "email_address", n => { EmailAddressProp = n.GetStringValue(); } },
{ "id", n => { Id = n.GetStringValue(); } },
{ "linked_to", n => { LinkedTo = n.GetCollectionOfObjectValues<global::Clerk.Net.Client.Models.IdentificationLink>(global::Clerk.Net.Client.Models.IdentificationLink.CreateFromDiscriminatorValue)?.AsList(); } },
{ "matches_sso_connection", n => { MatchesSsoConnection = n.GetBoolValue(); } },
{ "object", n => { Object = n.GetEnumValue<global::Clerk.Net.Client.Models.EmailAddress_object>(); } },
{ "reserved", n => { Reserved = n.GetBoolValue(); } },
{ "updated_at", n => { UpdatedAt = n.GetLongValue(); } },
Expand All @@ -91,13 +94,14 @@ public virtual void Serialize(ISerializationWriter writer)
writer.WriteStringValue("email_address", EmailAddressProp);
writer.WriteStringValue("id", Id);
writer.WriteCollectionOfObjectValues<global::Clerk.Net.Client.Models.IdentificationLink>("linked_to", LinkedTo);
writer.WriteBoolValue("matches_sso_connection", MatchesSsoConnection);
writer.WriteEnumValue<global::Clerk.Net.Client.Models.EmailAddress_object>("object", Object);
writer.WriteBoolValue("reserved", Reserved);
writer.WriteLongValue("updated_at", UpdatedAt);
writer.WriteObjectValue<global::Clerk.Net.Client.Models.EmailAddress.EmailAddress_verification>("verification", Verification);
}
/// <summary>
/// Composed type wrapper for classes <see cref="global::Clerk.Net.Client.Models.Admin"/>, <see cref="global::Clerk.Net.Client.Models.Oauth"/>, <see cref="global::Clerk.Net.Client.Models.OTP"/>
/// Composed type wrapper for classes <see cref="global::Clerk.Net.Client.Models.Admin"/>, <see cref="global::Clerk.Net.Client.Models.FromOAuth"/>, <see cref="global::Clerk.Net.Client.Models.OTP"/>
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class EmailAddress_verification : IComposedTypeWrapper, IParsable
Expand All @@ -110,13 +114,13 @@ public partial class EmailAddress_verification : IComposedTypeWrapper, IParsable
#else
public global::Clerk.Net.Client.Models.Admin Admin { get; set; }
#endif
/// <summary>Composed type representation for type <see cref="global::Clerk.Net.Client.Models.Oauth"/></summary>
/// <summary>Composed type representation for type <see cref="global::Clerk.Net.Client.Models.FromOAuth"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Clerk.Net.Client.Models.Oauth? Oauth { get; set; }
public global::Clerk.Net.Client.Models.FromOAuth? FromOAuth { get; set; }
#nullable restore
#else
public global::Clerk.Net.Client.Models.Oauth Oauth { get; set; }
public global::Clerk.Net.Client.Models.FromOAuth FromOAuth { get; set; }
#endif
/// <summary>Composed type representation for type <see cref="global::Clerk.Net.Client.Models.OTP"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand All @@ -140,13 +144,13 @@ public partial class EmailAddress_verification : IComposedTypeWrapper, IParsable
{
result.Admin = new global::Clerk.Net.Client.Models.Admin();
}
else if("OTP".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
else if("FromOAuth".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
{
result.OTP = new global::Clerk.Net.Client.Models.OTP();
result.FromOAuth = new global::Clerk.Net.Client.Models.FromOAuth();
}
else if("Oauth".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
else if("OTP".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
{
result.Oauth = new global::Clerk.Net.Client.Models.Oauth();
result.OTP = new global::Clerk.Net.Client.Models.OTP();
}
return result;
}
Expand All @@ -160,9 +164,9 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return Admin.GetFieldDeserializers();
}
else if(Oauth != null)
else if(FromOAuth != null)
{
return Oauth.GetFieldDeserializers();
return FromOAuth.GetFieldDeserializers();
}
else if(OTP != null)
{
Expand All @@ -181,9 +185,9 @@ public virtual void Serialize(ISerializationWriter writer)
{
writer.WriteObjectValue<global::Clerk.Net.Client.Models.Admin>(null, Admin);
}
else if(Oauth != null)
else if(FromOAuth != null)
{
writer.WriteObjectValue<global::Clerk.Net.Client.Models.Oauth>(null, Oauth);
writer.WriteObjectValue<global::Clerk.Net.Client.Models.FromOAuth>(null, FromOAuth);
}
else if(OTP != null)
{
Expand Down
Loading

0 comments on commit 7d209e7

Please sign in to comment.