7b0b9c7365
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
46 lines
1.6 KiB
C#
46 lines
1.6 KiB
C#
using System.Text.Json;
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.CentralUI.ScriptAnalysis;
|
|
|
|
/// <summary>
|
|
/// Request from the UI to execute a script in the central sandbox.
|
|
/// Parameters arrive as JSON values and are converted to .NET primitives
|
|
/// before being placed in the Parameters dictionary supplied to the script.
|
|
/// <see cref="Kind"/> selects which globals surface the script is compiled
|
|
/// and run against — template/shared scripts see <see cref="SandboxScriptHost"/>,
|
|
/// inbound API method scripts see <see cref="SandboxInboundScriptHost"/>.
|
|
/// <see cref="BindInstanceUniqueName"/>, when set, binds the run to a deployed
|
|
/// instance so <c>Instance</c>/<c>Attributes</c> access routes to it cross-site
|
|
/// instead of throwing. Ignored for inbound API scripts.
|
|
/// </summary>
|
|
public record SandboxRunRequest(
|
|
string Code,
|
|
Dictionary<string, JsonElement>? Parameters,
|
|
int? TimeoutSeconds,
|
|
ScriptKind Kind = ScriptKind.Template,
|
|
string? BindInstanceUniqueName = null);
|
|
|
|
public enum SandboxErrorKind
|
|
{
|
|
None,
|
|
CompileError,
|
|
SandboxLimitation,
|
|
RuntimeError,
|
|
Timeout
|
|
}
|
|
|
|
/// <summary>
|
|
/// Result of a Test Run. <see cref="Markers"/> carries Roslyn diagnostics
|
|
/// when <see cref="ErrorKind"/> is CompileError so the UI can display them
|
|
/// the same way it does for the editor's live problems panel.
|
|
/// </summary>
|
|
public record SandboxRunResult(
|
|
bool Success,
|
|
string? ReturnValueJson,
|
|
string? ReturnTypeName,
|
|
string ConsoleOutput,
|
|
string? Error,
|
|
SandboxErrorKind ErrorKind,
|
|
long DurationMs,
|
|
IReadOnlyList<DiagnosticMarker>? Markers);
|