Skip to content

Commit

Permalink
use CliHelper library
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm360 committed Jul 2, 2024
1 parent 68d019e commit f479384
Show file tree
Hide file tree
Showing 37 changed files with 71 additions and 1,051 deletions.
7 changes: 5 additions & 2 deletions src/EthernaGatewayCli/Commands/Etherna/DownloadCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Services;
using Etherna.GatewayCli.Services;
using Etherna.Sdk.Users.Clients;
using System;
using System.Reflection;
using System.Threading.Tasks;

namespace Etherna.GatewayCli.Commands.Etherna
Expand All @@ -28,11 +30,12 @@ public class DownloadCommand : CommandBase<DownloadCommandOptions>

// Constructor.
public DownloadCommand(
Assembly assembly,
IAuthenticationService authService,
IEthernaUserGatewayClient gatewayClient,
IIoService ioService,
IServiceProvider serviceProvider)
: base(ioService, serviceProvider)
: base(assembly, ioService, serviceProvider)
{
this.authService = authService;
this.gatewayClient = gatewayClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using Etherna.CliHelper.Models.Commands;
using System;
using System.Collections.Generic;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.BeeNet.Models;
using Etherna.GatewayCli.Models.Commands;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Services;
using Etherna.GatewayCli.Services;
using System;
using System.Reflection;
using System.Threading.Tasks;

namespace Etherna.GatewayCli.Commands.Etherna.Postage
Expand All @@ -28,11 +30,12 @@ public class CreateCommand : CommandBase<CreateCommandOptions>

// Constructor.
public CreateCommand(
Assembly assembly,
IAuthenticationService authService,
IGatewayService gatewayService,
IIoService ioService,
IServiceProvider serviceProvider)
: base(ioService, serviceProvider)
: base(assembly, ioService, serviceProvider)
{
this.authService = authService;
this.gatewayService = gatewayService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.BeeNet.Models;
using Etherna.GatewayCli.Models.Commands;
using Etherna.GatewayCli.Models.Commands.OptionRequirements;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Models.Commands.OptionRequirements;
using System;
using System.Collections.Generic;

Expand Down
7 changes: 5 additions & 2 deletions src/EthernaGatewayCli/Commands/Etherna/Postage/InfoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@

using Etherna.BeeNet.JsonConverters;
using Etherna.BeeNet.Models;
using Etherna.GatewayCli.Models.Commands;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Services;
using Etherna.GatewayCli.Services;
using Etherna.Sdk.Common.GenClients.Gateway;
using System;
using System.Reflection;
using System.Text.Json;
using System.Threading.Tasks;

Expand All @@ -43,11 +45,12 @@ public class InfoCommand : CommandBase

// Constructor.
public InfoCommand(
Assembly assembly,
IAuthenticationService authService,
IGatewayService gatewayService,
IIoService ioService,
IServiceProvider serviceProvider)
: base(ioService, serviceProvider)
: base(assembly, ioService, serviceProvider)
{
this.authService = authService;
this.gatewayService = gatewayService;
Expand Down
8 changes: 5 additions & 3 deletions src/EthernaGatewayCli/Commands/Etherna/PostageCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using Etherna.GatewayCli.Services;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Services;
using System;
using System.Reflection;

namespace Etherna.GatewayCli.Commands.Etherna
{
public class PostageCommand : CommandBase
{
// Constructor.
public PostageCommand(
Assembly assembly,
IIoService ioService,
IServiceProvider serviceProvider)
: base(ioService, serviceProvider)
: base(assembly, ioService, serviceProvider)
{ }

// Properties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using Etherna.GatewayCli.Services;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Services;
using System;
using System.Reflection;
using System.Threading.Tasks;

namespace Etherna.GatewayCli.Commands.Etherna.Resource
{
public class DefundCommand : CommandBase<DefundCommandOptions>
{
public DefundCommand(
Assembly assembly,
IIoService ioService,
IServiceProvider serviceProvider)
: base(ioService, serviceProvider)
: base(assembly, ioService, serviceProvider)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using Etherna.GatewayCli.Models.Commands.OptionRequirements;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Models.Commands.OptionRequirements;
using System.Collections.Generic;

namespace Etherna.GatewayCli.Commands.Etherna.Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Services;
using Etherna.GatewayCli.Services;
using System;
using System.Reflection;
using System.Threading.Tasks;

namespace Etherna.GatewayCli.Commands.Etherna.Resource
Expand All @@ -27,11 +29,12 @@ public class FundCommand : CommandBase<FundCommandOptions>

// Constructor.
public FundCommand(
Assembly assembly,
IAuthenticationService authService,
IGatewayService gatewayService,
IIoService ioService,
IServiceProvider serviceProvider)
: base(ioService, serviceProvider)
: base(assembly, ioService, serviceProvider)
{
this.authService = authService;
this.gatewayService = gatewayService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using Etherna.GatewayCli.Models.Commands.OptionRequirements;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Models.Commands.OptionRequirements;
using System.Collections.Generic;

namespace Etherna.GatewayCli.Commands.Etherna.Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using Etherna.GatewayCli.Services;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Services;
using System;
using System.Reflection;
using System.Threading.Tasks;

namespace Etherna.GatewayCli.Commands.Etherna.Resource
{
public class ListCommand : CommandBase
{
public ListCommand(
Assembly assembly,
IIoService ioService,
IServiceProvider serviceProvider)
: base(ioService, serviceProvider)
: base(assembly, ioService, serviceProvider)
{
}

Expand Down
8 changes: 5 additions & 3 deletions src/EthernaGatewayCli/Commands/Etherna/ResourceCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using Etherna.GatewayCli.Services;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Services;
using System;
using System.Reflection;

namespace Etherna.GatewayCli.Commands.Etherna
{
public class ResourceCommand : CommandBase
{
// Constructor.
public ResourceCommand(
Assembly assembly,
IIoService ioService,
IServiceProvider serviceProvider)
: base(ioService, serviceProvider)
: base(assembly, ioService, serviceProvider)
{ }

// Properties.
Expand Down
7 changes: 5 additions & 2 deletions src/EthernaGatewayCli/Commands/Etherna/UploadCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.BeeNet.Models;
using Etherna.GatewayCli.Models.Commands;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Services;
using Etherna.GatewayCli.Services;
using Etherna.Sdk.Common.GenClients.Gateway;
using System;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;

namespace Etherna.GatewayCli.Commands.Etherna
Expand All @@ -35,12 +37,13 @@ public class UploadCommand : CommandBase<UploadCommandOptions>

// Constructor.
public UploadCommand(
Assembly assembly,
IAuthenticationService authService,
IFileService fileService,
IGatewayService gatewayService,
IIoService ioService,
IServiceProvider serviceProvider)
: base(ioService, serviceProvider)
: base(assembly, ioService, serviceProvider)
{
this.authService = authService;
this.fileService = fileService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using Etherna.GatewayCli.Models.Commands.OptionRequirements;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Models.Commands.OptionRequirements;
using System;
using System.Collections.Generic;

Expand Down
8 changes: 5 additions & 3 deletions src/EthernaGatewayCli/Commands/EthernaCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using Etherna.GatewayCli.Services;
using Etherna.CliHelper.Models.Commands;
using Etherna.CliHelper.Services;
using Etherna.GatewayCli.Utilities;
using System;
using System.Reflection;
using System.Threading.Tasks;

namespace Etherna.GatewayCli.Commands
Expand All @@ -24,9 +25,10 @@ public class EthernaCommand : CommandBase<EthernaCommandOptions>
{
// Constructor.
public EthernaCommand(
Assembly assembly,
IIoService ioService,
IServiceProvider serviceProvider)
: base(ioService, serviceProvider)
: base(assembly, ioService, serviceProvider)
{ }

// Properties.
Expand Down
3 changes: 1 addition & 2 deletions src/EthernaGatewayCli/Commands/EthernaCommandOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// You should have received a copy of the GNU Affero General Public License along with Etherna Gateway CLI.
// If not, see <https://www.gnu.org/licenses/>.

using Etherna.GatewayCli.Models.Commands;
using System;
using Etherna.CliHelper.Models.Commands;
using System.Collections.Generic;

namespace Etherna.GatewayCli.Commands
Expand Down
1 change: 1 addition & 0 deletions src/EthernaGatewayCli/EthernaGatewayCli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Etherna.CliHelper" Version="0.1.0" />
<PackageReference Include="EthernaSdk.Users.Native" Version="0.4.0-alpha.56" />
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
Loading

0 comments on commit f479384

Please sign in to comment.