-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Program class and basic architecture
- Loading branch information
Showing
16 changed files
with
677 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2024-present Etherna SA | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Etherna.GatewayCli.Commands | ||
{ | ||
public class DownloadCommand : ICommand | ||
{ | ||
// Properties. | ||
public string Description => "Download a resource from Swarm"; | ||
public string Name => "download"; | ||
|
||
// Methods. | ||
public void PrintHelp() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task RunAsync(string[] args) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2024-present Etherna SA | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System.Threading.Tasks; | ||
|
||
namespace Etherna.GatewayCli.Commands | ||
{ | ||
public interface ICommand | ||
{ | ||
// Properties. | ||
string Description { get; } | ||
string Name { get; } | ||
|
||
// Methods. | ||
void PrintHelp(); | ||
Task RunAsync(string[] args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2024-present Etherna SA | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Etherna.GatewayCli.Commands | ||
{ | ||
public class PostageCommand : ICommand | ||
{ | ||
// Properties. | ||
public string Description => "Manage postage batches"; | ||
public string Name => "postage"; | ||
|
||
// Methods. | ||
public void PrintHelp() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task RunAsync(string[] args) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2024-present Etherna SA | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Etherna.GatewayCli.Commands | ||
{ | ||
public class ResourceCommand : ICommand | ||
{ | ||
// Properties. | ||
public string Description => "Manage resources on Gateway"; | ||
public string Name => "resource"; | ||
|
||
// Methods. | ||
public void PrintHelp() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task RunAsync(string[] args) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2024-present Etherna SA | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Etherna.GatewayCli.Commands | ||
{ | ||
public class UploadCommand : ICommand | ||
{ | ||
// Properties. | ||
public string Description => "Upload a resource to Swarm"; | ||
public string Name => "upload"; | ||
|
||
// Methods. | ||
public void PrintHelp() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task RunAsync(string[] args) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2024-present Etherna SA | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using Etherna.BeeNet.Clients.GatewayApi; | ||
|
||
namespace Etherna.GatewayCli | ||
{ | ||
public static class CommonConsts | ||
{ | ||
public const GatewayApiVersion BeeNodeGatewayVersion = GatewayApiVersion.v5_0_0; | ||
public const string EthernaGatewayCliClientId = "689efb99-e2a3-4cb5-ba86-d1e07a71991f"; | ||
public const string EthernaGatewayUrl = "https://gateway.etherna.io/"; | ||
public const string EthernaSsoUrl = "https://sso.etherna.io/"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,46 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Etherna.GatewayCli</RootNamespace> | ||
|
||
<Authors>Etherna SA</Authors> | ||
<Description>A CLI interface to the Etherna Gateway</Description> | ||
|
||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<Nullable>enable</Nullable> | ||
<EnableNETAnalyzers>true</EnableNETAnalyzers> | ||
<AnalysisMode>AllEnabledByDefault</AnalysisMode> | ||
|
||
<InvariantGlobalization>true</InvariantGlobalization> | ||
|
||
<AssemblyName>etherna</AssemblyName> | ||
<RepositoryUrl>https://github.com/Etherna/etherna-gateway-cli</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<IncludeSymbols>true</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<FrameworkReference Include="Microsoft.AspNetCore.App" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Bee.Net" Version="0.2.0-alpha.218" /> | ||
<PackageReference Include="EthernaSdk.Users.Native" Version="0.3.3" /> | ||
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
</Project> |
33 changes: 33 additions & 0 deletions
33
src/EthernaGatewayCli/Models/GitHubDto/GitReleaseVersionDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2024-present Etherna SA | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
|
||
namespace Etherna.GatewayCli.Models.GitHubDto | ||
{ | ||
public class GitReleaseVersionDto | ||
{ | ||
// Properties. | ||
public string Assets_url { get; set; } = default!; | ||
public DateTime Created_at { get; set; } | ||
public bool Draft { get; set; } | ||
public string Html_url { get; set; } = default!; | ||
public int Id { get; set; } = default!; | ||
public string Name { get; set; } = default!; | ||
public bool Prerelease { get; set; } | ||
public DateTime Published_at { get; set; } | ||
public string Tag_name { get; set; } = default!; | ||
public string Url { get; set; } = default!; | ||
} | ||
} |
Oops, something went wrong.