Move models to client lib
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Kieran 2024-02-02 16:44:28 +00:00
parent f48bc11644
commit 5262c59509
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
15 changed files with 16 additions and 41 deletions

View File

@ -1,7 +1,7 @@
using Newtonsoft.Json;
using ProtoBuf;
namespace NostrServices.Model;
namespace NostrServices.Client;
[ProtoContract]
public class LinkPreviewData

View File

@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RepositoryUrl>https://git.v0l.io/Kieran/NostrServices</RepositoryUrl>
<Version>1.0.2</Version>
<Version>1.0.3</Version>
<Authors>Kieran</Authors>
<Description>Client wrapper for https://nostr.api.v0l.io</Description>
<PackageProjectUrl>https://git.v0l.io/Kieran/NostrServices</PackageProjectUrl>
@ -17,10 +17,7 @@
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Nostr.Client" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NostrServices.Model\NostrServices.Model.csproj" />
<PackageReference Include="protobuf-net.Core" Version="3.2.30" />
</ItemGroup>
</Project>

View File

@ -2,7 +2,6 @@ using System.Net.Http.Headers;
using Newtonsoft.Json;
using Nostr.Client.Json;
using Nostr.Client.Messages;
using NostrServices.Model;
namespace NostrServices.Client;

View File

@ -5,7 +5,7 @@ using Nostr.Client.Messages;
using Nostr.Client.Messages.Metadata;
using ProtoBuf;
namespace NostrServices.Model;
namespace NostrServices.Client;
[ProtoContract]
public class CompactProfile

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json;
namespace NostrServices.Model;
namespace NostrServices.Client;
public class RelayDistance
{

View File

@ -1,15 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Nostr.Client" Version="2.0.0" />
<PackageReference Include="protobuf-net.Core" Version="3.2.30" />
</ItemGroup>
</Project>

View File

@ -19,8 +19,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PayForReactions", "PayForRe
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NostrServices.Client", "NostrServices.Client\NostrServices.Client.csproj", "{17CA7036-95BC-4851-BAB1-419996EA2761}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NostrServices.Model", "NostrServices.Model\NostrServices.Model.csproj", "{70E7A5B7-005F-4EEE-9C0D-7FFB1389ED2A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -51,9 +49,5 @@ Global
{17CA7036-95BC-4851-BAB1-419996EA2761}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17CA7036-95BC-4851-BAB1-419996EA2761}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17CA7036-95BC-4851-BAB1-419996EA2761}.Release|Any CPU.Build.0 = Release|Any CPU
{70E7A5B7-005F-4EEE-9C0D-7FFB1389ED2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{70E7A5B7-005F-4EEE-9C0D-7FFB1389ED2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{70E7A5B7-005F-4EEE-9C0D-7FFB1389ED2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{70E7A5B7-005F-4EEE-9C0D-7FFB1389ED2A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Nostr.Client.Json;
using Nostr.Client.Messages;
using NostrServices.Model;
using NostrServices.Client;
using NostrServices.Services;
namespace NostrServices.Controllers;

View File

@ -3,7 +3,7 @@ using System.Text;
using AngleSharp;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using NostrServices.Model;
using NostrServices.Client;
using StackExchange.Redis;
namespace NostrServices.Controllers;

View File

@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
using Nostr.Client.Identifiers;
using Nostr.Client.Messages;
using Nostr.Client.Utils;
using NostrServices.Model;
using NostrServices.Client;
using NostrServices.Services;
using ProtoBuf;

View File

@ -45,10 +45,10 @@ public class LatLonReq
public static class RelayDistanceExtension
{
public static Model.RelayDistance FromDistance(this RelayDistance x)
public static Client.RelayDistance FromDistance(this RelayDistance x)
{
var rp = x.Relay.Positions.FirstOrDefault(a => a.IpAddress == x.IpAddress) ?? x.Relay.Positions.First();
return new Model.RelayDistance()
return new Client.RelayDistance()
{
Url = x.Relay.Url,
Distance = x.Distance,
@ -63,10 +63,10 @@ public static class RelayDistanceExtension
};
}
public static Model.RelayDistance FromInfo(this RelayInfo x)
public static Client.RelayDistance FromInfo(this RelayInfo x)
{
var rp = x.Positions.First();
return new Model.RelayDistance()
return new Client.RelayDistance()
{
Url = x.Url,
Distance = 0,

View File

@ -5,7 +5,7 @@ using Nostr.Client.Json;
using Nostr.Client.Messages;
using Nostr.Client.Utils;
using NostrRelay;
using NostrServices.Model;
using NostrServices.Client;
using NostrServices.Services;
using ProtoBuf;
using StackExchange.Redis;

View File

@ -31,7 +31,7 @@
<ItemGroup>
<ProjectReference Include="..\NostrRelay\NostrRelay.csproj" />
<ProjectReference Include="..\NostrServices.Model\NostrServices.Model.csproj" />
<ProjectReference Include="..\NostrServices.Client\NostrServices.Client.csproj" />
</ItemGroup>
</Project>

View File

@ -1,7 +1,7 @@
using NBitcoin;
using Newtonsoft.Json;
using Nostr.Client.Messages;
using NostrServices.Model;
using NostrServices.Client;
namespace NostrServices.Services.EventHandlers;

View File

@ -2,7 +2,7 @@ using NBitcoin;
using Nostr.Client.Identifiers;
using Nostr.Client.Messages;
using Nostr.Client.Utils;
using NostrServices.Model;
using NostrServices.Client;
using ProtoBuf;
using StackExchange.Redis;