Move models to client lib
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using ProtoBuf;
|
using ProtoBuf;
|
||||||
|
|
||||||
namespace NostrServices.Model;
|
namespace NostrServices.Client;
|
||||||
|
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public class LinkPreviewData
|
public class LinkPreviewData
|
@ -6,7 +6,7 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<RepositoryUrl>https://git.v0l.io/Kieran/NostrServices</RepositoryUrl>
|
<RepositoryUrl>https://git.v0l.io/Kieran/NostrServices</RepositoryUrl>
|
||||||
<Version>1.0.2</Version>
|
<Version>1.0.3</Version>
|
||||||
<Authors>Kieran</Authors>
|
<Authors>Kieran</Authors>
|
||||||
<Description>Client wrapper for https://nostr.api.v0l.io</Description>
|
<Description>Client wrapper for https://nostr.api.v0l.io</Description>
|
||||||
<PackageProjectUrl>https://git.v0l.io/Kieran/NostrServices</PackageProjectUrl>
|
<PackageProjectUrl>https://git.v0l.io/Kieran/NostrServices</PackageProjectUrl>
|
||||||
@ -17,10 +17,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<PackageReference Include="Nostr.Client" Version="2.0.0" />
|
<PackageReference Include="Nostr.Client" Version="2.0.0" />
|
||||||
</ItemGroup>
|
<PackageReference Include="protobuf-net.Core" Version="3.2.30" />
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\NostrServices.Model\NostrServices.Model.csproj" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -2,7 +2,6 @@ using System.Net.Http.Headers;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Nostr.Client.Json;
|
using Nostr.Client.Json;
|
||||||
using Nostr.Client.Messages;
|
using Nostr.Client.Messages;
|
||||||
using NostrServices.Model;
|
|
||||||
|
|
||||||
namespace NostrServices.Client;
|
namespace NostrServices.Client;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ using Nostr.Client.Messages;
|
|||||||
using Nostr.Client.Messages.Metadata;
|
using Nostr.Client.Messages.Metadata;
|
||||||
using ProtoBuf;
|
using ProtoBuf;
|
||||||
|
|
||||||
namespace NostrServices.Model;
|
namespace NostrServices.Client;
|
||||||
|
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public class CompactProfile
|
public class CompactProfile
|
@ -1,6 +1,6 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace NostrServices.Model;
|
namespace NostrServices.Client;
|
||||||
|
|
||||||
public class RelayDistance
|
public class RelayDistance
|
||||||
{
|
{
|
@ -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>
|
|
@ -19,8 +19,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PayForReactions", "PayForRe
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NostrServices.Client", "NostrServices.Client\NostrServices.Client.csproj", "{17CA7036-95BC-4851-BAB1-419996EA2761}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NostrServices.Client", "NostrServices.Client\NostrServices.Client.csproj", "{17CA7036-95BC-4851-BAB1-419996EA2761}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NostrServices.Model", "NostrServices.Model\NostrServices.Model.csproj", "{70E7A5B7-005F-4EEE-9C0D-7FFB1389ED2A}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
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}.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.ActiveCfg = Release|Any CPU
|
||||||
{17CA7036-95BC-4851-BAB1-419996EA2761}.Release|Any CPU.Build.0 = 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
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Nostr.Client.Json;
|
using Nostr.Client.Json;
|
||||||
using Nostr.Client.Messages;
|
using Nostr.Client.Messages;
|
||||||
using NostrServices.Model;
|
using NostrServices.Client;
|
||||||
using NostrServices.Services;
|
using NostrServices.Services;
|
||||||
|
|
||||||
namespace NostrServices.Controllers;
|
namespace NostrServices.Controllers;
|
||||||
|
@ -3,7 +3,7 @@ using System.Text;
|
|||||||
using AngleSharp;
|
using AngleSharp;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using NostrServices.Model;
|
using NostrServices.Client;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
|
||||||
namespace NostrServices.Controllers;
|
namespace NostrServices.Controllers;
|
||||||
|
@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using Nostr.Client.Identifiers;
|
using Nostr.Client.Identifiers;
|
||||||
using Nostr.Client.Messages;
|
using Nostr.Client.Messages;
|
||||||
using Nostr.Client.Utils;
|
using Nostr.Client.Utils;
|
||||||
using NostrServices.Model;
|
using NostrServices.Client;
|
||||||
using NostrServices.Services;
|
using NostrServices.Services;
|
||||||
using ProtoBuf;
|
using ProtoBuf;
|
||||||
|
|
||||||
|
@ -45,10 +45,10 @@ public class LatLonReq
|
|||||||
|
|
||||||
public static class RelayDistanceExtension
|
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();
|
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,
|
Url = x.Relay.Url,
|
||||||
Distance = x.Distance,
|
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();
|
var rp = x.Positions.First();
|
||||||
return new Model.RelayDistance()
|
return new Client.RelayDistance()
|
||||||
{
|
{
|
||||||
Url = x.Url,
|
Url = x.Url,
|
||||||
Distance = 0,
|
Distance = 0,
|
||||||
|
@ -5,7 +5,7 @@ using Nostr.Client.Json;
|
|||||||
using Nostr.Client.Messages;
|
using Nostr.Client.Messages;
|
||||||
using Nostr.Client.Utils;
|
using Nostr.Client.Utils;
|
||||||
using NostrRelay;
|
using NostrRelay;
|
||||||
using NostrServices.Model;
|
using NostrServices.Client;
|
||||||
using NostrServices.Services;
|
using NostrServices.Services;
|
||||||
using ProtoBuf;
|
using ProtoBuf;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\NostrRelay\NostrRelay.csproj" />
|
<ProjectReference Include="..\NostrRelay\NostrRelay.csproj" />
|
||||||
<ProjectReference Include="..\NostrServices.Model\NostrServices.Model.csproj" />
|
<ProjectReference Include="..\NostrServices.Client\NostrServices.Client.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using NBitcoin;
|
using NBitcoin;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Nostr.Client.Messages;
|
using Nostr.Client.Messages;
|
||||||
using NostrServices.Model;
|
using NostrServices.Client;
|
||||||
|
|
||||||
namespace NostrServices.Services.EventHandlers;
|
namespace NostrServices.Services.EventHandlers;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ using NBitcoin;
|
|||||||
using Nostr.Client.Identifiers;
|
using Nostr.Client.Identifiers;
|
||||||
using Nostr.Client.Messages;
|
using Nostr.Client.Messages;
|
||||||
using Nostr.Client.Utils;
|
using Nostr.Client.Utils;
|
||||||
using NostrServices.Model;
|
using NostrServices.Client;
|
||||||
using ProtoBuf;
|
using ProtoBuf;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user