From b3a2900546cb320d87748ea9ce181364569a1af0 Mon Sep 17 00:00:00 2001 From: "Eduard.Dumitru" Date: Fri, 14 Jan 2022 18:59:01 +0200 Subject: [PATCH 1/3] DB Credentials --- .../DB/DBCredentialsConfiguration.cs | 15 ++++++++++++-- .../Credentials/DB/DBCredentialsManager.cs | 8 ++++---- .../Credentials/DB/DbAuthenticationType.cs | 7 +++++++ .../Models/Credentials/DB/DbClientType.cs | 7 +++++++ .../Models/Credentials/DB/DbProtocolType.cs | 10 ++++++++++ .../Models/Credentials/DB/IDbClient.cs | 20 +++++++++++++++++++ 6 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbAuthenticationType.cs create mode 100644 Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbClientType.cs create mode 100644 Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbProtocolType.cs create mode 100644 Ringhel.Procesio.Action.Core/Models/Credentials/DB/IDbClient.cs diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DBCredentialsConfiguration.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DBCredentialsConfiguration.cs index 89e9dc0..a96b769 100644 --- a/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DBCredentialsConfiguration.cs +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DBCredentialsConfiguration.cs @@ -1,6 +1,17 @@ -namespace Ringhel.Procesio.Action.Core.Models.Credentials.DB +namespace Ringhel.Procesio.Action.Core.Models { - public class DBCredentialsConfiguration + public class DbCredentialsConfiguration { + public string ServerName { get; set; } + public DbClientType ServerType { get; set; } + public DbProtocolType ProtocolType { get; set; } + public int? PortNumber { get; set; } + public DbAuthenticationType AuthenticationType { get; set; } + public bool? Encrypt { get; set; } + public bool? Pooling { get; set; } + public bool? TrustServerCertificate { get; set; } + public string DatabaseName { get; set; } + public string Username { get; set; } + public string Password { get; set; } } } diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DBCredentialsManager.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DBCredentialsManager.cs index 3e879f8..c1f2071 100644 --- a/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DBCredentialsManager.cs +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DBCredentialsManager.cs @@ -1,11 +1,11 @@ using System.Data.Common; -namespace Ringhel.Procesio.Action.Core.Models.Credentials.DB +namespace Ringhel.Procesio.Action.Core.Models { - public class DBCredentialsManager + public class DbCredentialsManager { - public DBCredentialsConfiguration CredentialsConfiguration { get; set; } + public DbCredentialsConfiguration CredentialsConfiguration { get; set; } - public DbConnection Client { get; set; } + public IDbClient Client { get; set; } } } diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbAuthenticationType.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbAuthenticationType.cs new file mode 100644 index 0000000..097aee0 --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbAuthenticationType.cs @@ -0,0 +1,7 @@ +namespace Ringhel.Procesio.Action.Core.Models +{ + public enum DbAuthenticationType + { + CredentialsAuthentication = 1 + } +} diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbClientType.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbClientType.cs new file mode 100644 index 0000000..a1d0d7f --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbClientType.cs @@ -0,0 +1,7 @@ +namespace Ringhel.Procesio.Action.Core.Models +{ + public enum DbClientType + { + MSSQL = 1 + } +} diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbProtocolType.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbProtocolType.cs new file mode 100644 index 0000000..71b01c2 --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/DbProtocolType.cs @@ -0,0 +1,10 @@ +namespace Ringhel.Procesio.Action.Core.Models +{ + public enum DbProtocolType + { + NONE = 1, + TCP = 2, + LPC = 3, + NP = 4 + } +} diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/DB/IDbClient.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/IDbClient.cs new file mode 100644 index 0000000..d43aefa --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/DB/IDbClient.cs @@ -0,0 +1,20 @@ +using System.Data; +using System.Threading.Tasks; + +namespace Ringhel.Procesio.Action.Core.Models +{ + public interface IDbClient + { + /// + /// Execute a query that will return a list + /// + Task ExecuteQuery(string dbQuery); + + /// + /// Execute a command that will return an int + /// Examples: COUNT, INSERT, UPDATE, ... + /// + /// + Task ExecuteCommand(string dbQuery); + } +} \ No newline at end of file From d5a38134803a03303eac6071fba5e69aaee7d6e4 Mon Sep 17 00:00:00 2001 From: "Eduard.Dumitru" Date: Mon, 17 Jan 2022 18:00:43 +0200 Subject: [PATCH 2/3] Added FeTextFormat --- .../ActionDecorators/FEDecoratorAttribute.cs | 5 +++++ Ringhel.Procesio.Action.Core/Utils/FeTextFormat.cs | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 Ringhel.Procesio.Action.Core/Utils/FeTextFormat.cs diff --git a/Ringhel.Procesio.Action.Core/ActionDecorators/FEDecoratorAttribute.cs b/Ringhel.Procesio.Action.Core/ActionDecorators/FEDecoratorAttribute.cs index af883b4..4613560 100644 --- a/Ringhel.Procesio.Action.Core/ActionDecorators/FEDecoratorAttribute.cs +++ b/Ringhel.Procesio.Action.Core/ActionDecorators/FEDecoratorAttribute.cs @@ -42,6 +42,11 @@ public class FEDecoratorAttribute : Attribute /// public FeComponentType Type { get; set; } + /// + /// Set different text formats: SQL, JSON, PLAINTEXT, etc. + /// + public FeTextFormat TextFormat { get; set; } = FeTextFormat.PLAINTEXT; + /// /// Property Row number. Used when showing the property in the Action configuration panel. /// If not set, all properties will be placed on the same default row. diff --git a/Ringhel.Procesio.Action.Core/Utils/FeTextFormat.cs b/Ringhel.Procesio.Action.Core/Utils/FeTextFormat.cs new file mode 100644 index 0000000..99569f1 --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Utils/FeTextFormat.cs @@ -0,0 +1,10 @@ +namespace Ringhel.Procesio.Action.Core.Utils +{ + public enum FeTextFormat + { + NONE = 0, + PLAINTEXT = 1, + JSON = 2, + SQL = 3 + } +} \ No newline at end of file From 94dddc622272e75d1fb326f4353491ccaa15d3cc Mon Sep 17 00:00:00 2001 From: "Eduard.Dumitru" Date: Thu, 20 Jan 2022 11:09:47 +0200 Subject: [PATCH 3/3] Update Ringhel.Procesio.Action.Core.csproj --- .../Ringhel.Procesio.Action.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ringhel.Procesio.Action.Core/Ringhel.Procesio.Action.Core.csproj b/Ringhel.Procesio.Action.Core/Ringhel.Procesio.Action.Core.csproj index df4983a..de29825 100644 --- a/Ringhel.Procesio.Action.Core/Ringhel.Procesio.Action.Core.csproj +++ b/Ringhel.Procesio.Action.Core/Ringhel.Procesio.Action.Core.csproj @@ -7,7 +7,7 @@ Ringhel Procesio https://github.com/PROCESIO/Action-Core.git - 1.16.0.4 + 1.16.1.1 Ringhel.Procesio.Action.Core Ringhel.Procesio.Action.Core Ringhel.Procesio.Action.Core