3dd492a77f
The data plane answers a broken inbound method with the generic "Script compilation failed for this method"; the Roslyn diagnostic reached only the central log, and the known-bad cache could not be observed or reset per method. - InboundScriptExecutor keeps the diagnostics with each known-bad record and exposes GetCompileState(name, currentScript): IsCompiled / IsKnownBad / LastCompileError, judged against the current script text (a record for older text is reported as not compiled yet). - Management: ValidateApiMethodCommand (compile the stored script, return ApiMethodCompileResult, register nothing, cache untouched) and RecompileApiMethodCommand (CompileAndRegister without re-sending the entity, drops the node's ApiMethodCache row, audited "Recompile"). Both Designer, like UpdateApiMethod; dispatched through the shared ApiMethodCompileOperations. GetApiMethod keeps the entity fields top-level and adds isCompiled, isKnownBad, lastCompileError and compileStateNode. Compile state is per central node and every result names the node. - CLI: api-method validate --id, api-method recompile --id. - Central UI: the API-method edit page shows the saved script's compile state and last error, with Validate and Recompile actions (same operations, same Designer gate, fresh DI scope). - RequiredRoleMatrixTests entries; ManagementSurfaceParityTests covers the new CLI leaves; ApiMethodCompileDiagnosticsTests + an executor CompileState test. - Docs: CLI README, Component-CLI/ManagementService/InboundAPI, components/*. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
25 lines
1.6 KiB
C#
25 lines
1.6 KiB
C#
namespace ZB.MOM.WW.ScadaBridge.Commons.Messages.Management;
|
|
|
|
public record ListApiMethodsCommand;
|
|
public record GetApiMethodCommand(int ApiMethodId);
|
|
/// <param name="TraceAllCalls">Flow Debugger (design 2026-09-05 §5.2): trace every production call to this method. Additive; defaults to off.</param>
|
|
public record CreateApiMethodCommand(string Name, string Script, int TimeoutSeconds, string? ParameterDefinitions, string? ReturnDefinition, bool TraceAllCalls = false);
|
|
/// <param name="TraceAllCalls">Flow Debugger (design 2026-09-05 §5.2): <c>null</c> leaves the stored value unchanged so an older CLI never resets it.</param>
|
|
public record UpdateApiMethodCommand(int ApiMethodId, string Script, int TimeoutSeconds, string? ParameterDefinitions, string? ReturnDefinition, bool? TraceAllCalls = null);
|
|
public record DeleteApiMethodCommand(int ApiMethodId);
|
|
/// <summary>
|
|
/// Compiles the method's stored script on the receiving central node and returns the
|
|
/// diagnostics, without registering the handler or touching the known-bad cache
|
|
/// (ScadaBridge#75). Operators see the real compile error here; the data plane keeps
|
|
/// returning its generic message.
|
|
/// </summary>
|
|
/// <param name="ApiMethodId">The API method to validate.</param>
|
|
public record ValidateApiMethodCommand(int ApiMethodId);
|
|
/// <summary>
|
|
/// Re-runs <c>CompileAndRegister</c> for the method's stored script on the receiving central
|
|
/// node, replacing its cached handler or known-bad record, without re-sending the entity
|
|
/// (ScadaBridge#75). Returns the diagnostics.
|
|
/// </summary>
|
|
/// <param name="ApiMethodId">The API method to recompile.</param>
|
|
public record RecompileApiMethodCommand(int ApiMethodId);
|