diff --git a/src/libraries/Microsoft.PowerFx.Core/AssemblyProperties.cs b/src/libraries/Microsoft.PowerFx.Core/AssemblyProperties.cs index 2f807e13e8..505025fcc2 100644 --- a/src/libraries/Microsoft.PowerFx.Core/AssemblyProperties.cs +++ b/src/libraries/Microsoft.PowerFx.Core/AssemblyProperties.cs @@ -44,3 +44,6 @@ [assembly: InternalsVisibleTo("Microsoft.PowerFx.Json.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + +// PiFlows Server +[assembly: InternalsVisibleTo("Berry.PiFlow.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100013b46091645a2e69cb6b4793aa9d1603c26d9a9723a68036913d487c51ce7bc1ad3ba01e42d2d88e57620515beb899b3aec91e0bc7ff97bf64b883917170c6b1360b51a2056a302db97fc425c5f26c1b7a875f3780e226b62bfc5599090e8d0eee028d40af84fc9049f8def05357ce0c38c807bd52b79d7d23d2ffb654cd6b7")] \ No newline at end of file diff --git a/src/libraries/Microsoft.PowerFx.Core/Public/CheckResult.cs b/src/libraries/Microsoft.PowerFx.Core/Public/CheckResult.cs index 0e3a25d145..5ed85f2a2c 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Public/CheckResult.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Public/CheckResult.cs @@ -240,12 +240,14 @@ internal TexlBinding Binding } } +#pragma warning disable CS1574, CS1584, CS1581, CS1580 /// /// List of all errors and warnings. Check . /// This can include Parse, Bind, and per-engine custom errors (see , /// or any custom errors passes explicit to the ctor. /// Not null, but empty on success. /// +#pragma warning restore CS1574, CS1584, CS1581, CS1580 public IEnumerable Errors { get => GetErrorsInLocale(null); @@ -450,12 +452,14 @@ public void ApplyDependencyAnalysis() // Flag to ensure Post Checks are only invoked once. private bool _invokingPostCheck; - + +#pragma warning disable CS1574, CS1584, CS1581, CS1580 /// /// Calculate all errors. /// Invoke Binding and any engine-specific errors via . /// /// +#pragma warning restore CS1574, CS1584, CS1581, CS1580 public IEnumerable ApplyErrors() { if (!_invokingPostCheck) diff --git a/src/libraries/Microsoft.PowerFx.Core/Types/FunctionCategories.cs b/src/libraries/Microsoft.PowerFx.Core/Types/FunctionCategories.cs index dad4feb5e8..ab82faddde 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Types/FunctionCategories.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Types/FunctionCategories.cs @@ -8,7 +8,9 @@ namespace Microsoft.PowerFx.Core.Types { [Flags] [TransportType(TransportKind.Enum)] - internal enum FunctionCategories : uint +#pragma warning disable CA1028 + public enum FunctionCategories : uint +#pragma warning restore CA1028 { None = 0x0, Text = 0x1, @@ -20,6 +22,7 @@ internal enum FunctionCategories : uint Information = 0x40, Color = 0x80, REST = 0x100, - Component = 0x200 + Component = 0x200, + PiFlow = 0x400 } } diff --git a/src/libraries/Microsoft.PowerFx.Interpreter/AssemblyProperties.cs b/src/libraries/Microsoft.PowerFx.Interpreter/AssemblyProperties.cs index e38a3d5544..22fa4aa6a6 100644 --- a/src/libraries/Microsoft.PowerFx.Interpreter/AssemblyProperties.cs +++ b/src/libraries/Microsoft.PowerFx.Interpreter/AssemblyProperties.cs @@ -5,3 +5,6 @@ [assembly: InternalsVisibleTo("Microsoft.PowerFx.Interpreter.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("Microsoft.PowerFx.Connectors, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] + +// PiFlows Server +[assembly: InternalsVisibleTo("Berry.PiFlow.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100013b46091645a2e69cb6b4793aa9d1603c26d9a9723a68036913d487c51ce7bc1ad3ba01e42d2d88e57620515beb899b3aec91e0bc7ff97bf64b883917170c6b1360b51a2056a302db97fc425c5f26c1b7a875f3780e226b62bfc5599090e8d0eee028d40af84fc9049f8def05357ce0c38c807bd52b79d7d23d2ffb654cd6b7")] diff --git a/src/libraries/Microsoft.PowerFx.Interpreter/ParsedExpression.cs b/src/libraries/Microsoft.PowerFx.Interpreter/ParsedExpression.cs index fde3ff2084..616c02e7d0 100644 --- a/src/libraries/Microsoft.PowerFx.Interpreter/ParsedExpression.cs +++ b/src/libraries/Microsoft.PowerFx.Interpreter/ParsedExpression.cs @@ -19,6 +19,8 @@ namespace Microsoft.PowerFx /// public interface IExpressionEvaluator { + ReadOnlySymbolValues NewFromRecordValue(RecordValue recordValue = null); + public Task EvalAsync(CancellationToken cancellationToken, IRuntimeConfig runtimeConfig = null); } @@ -137,6 +139,9 @@ async Task IExpression.EvalAsync(RecordValue parameters, Cancellat } } + public ReadOnlySymbolValues NewFromRecordValue(RecordValue recordValue = null) => + ReadOnlySymbolValues.NewFromRecord(_parameterSymbolTable, recordValue); + public async Task EvalAsync(CancellationToken cancellationToken, IRuntimeConfig runtimeConfig = null) { ReadOnlySymbolValues symbolValues = ComposedReadOnlySymbolValues.New( diff --git a/src/libraries/Microsoft.PowerFx.Interpreter/ReflectionFunction.cs b/src/libraries/Microsoft.PowerFx.Interpreter/ReflectionFunction.cs index 51520a750a..cc0fe0ce1c 100644 --- a/src/libraries/Microsoft.PowerFx.Interpreter/ReflectionFunction.cs +++ b/src/libraries/Microsoft.PowerFx.Interpreter/ReflectionFunction.cs @@ -45,6 +45,26 @@ public CustomTexlFunction(string name, DType returnType, params DType[] paramTyp { } + protected CustomTexlFunction( + string name, + string description, + FunctionCategories functionCategories, + FormulaType returnType, + params FormulaType[] paramTypes) + : base( + DPath.Root, + name, + name, + SG(description), + functionCategories, + returnType._type, + 0, + paramTypes.Length, + paramTypes.Length, + Array.ConvertAll(paramTypes, p => p._type)) + { + } + public override bool IsSelfContained => true; public static StringGetter SG(string text) @@ -137,7 +157,7 @@ public async Task InvokeAsync(FormulaValue[] args, CancellationTok return await result; } } - + /// /// Base class for importing a C# function into Power Fx. /// Dervied class should follow this convention: