feat(inbound-api): ApiMethod.TraceAllCalls (entity, migration, mgmt command, CLI --trace-all-calls)
Flow Debugger (design 2026-09-05 §5.2): bit NOT NULL DEFAULT 0 column + EF migration 20260906034113 with its docs/plans/sql production twin. CreateApiMethodCommand gains TraceAllCalls=false; UpdateApiMethodCommand gains bool? TraceAllCalls (null = unchanged so an older CLI never resets it). Management result echoes the flag; CLI create/update expose --trace-all-calls; README carries the ~7-rows-per-call warning. Claude-Session: https://claude.ai/code/session_01GSLkkHKz9JrAtmJjmQK3cP
This commit is contained in:
@@ -60,6 +60,10 @@ public static class ApiMethodCommands
|
||||
timeoutOption.DefaultValueFactory = _ => 30;
|
||||
var parametersOption = new Option<string?>("--parameters") { Description = "Parameter definitions JSON" };
|
||||
var returnDefOption = new Option<string?>("--return-def") { Description = "Return type definition" };
|
||||
var traceAllCallsOption = new Option<bool>("--trace-all-calls")
|
||||
{
|
||||
Description = "Trace every production call to this method for the Flow Debugger (adds ~7 audit rows per call; low-volume integration methods only)"
|
||||
};
|
||||
|
||||
var cmd = new Command("create") { Description = "Create an API method" };
|
||||
cmd.Add(nameOption);
|
||||
@@ -67,6 +71,7 @@ public static class ApiMethodCommands
|
||||
cmd.Add(timeoutOption);
|
||||
cmd.Add(parametersOption);
|
||||
cmd.Add(returnDefOption);
|
||||
cmd.Add(traceAllCallsOption);
|
||||
cmd.SetAction(async (ParseResult result) =>
|
||||
{
|
||||
var name = result.GetValue(nameOption)!;
|
||||
@@ -74,9 +79,10 @@ public static class ApiMethodCommands
|
||||
var timeout = result.GetValue(timeoutOption);
|
||||
var parameters = result.GetValue(parametersOption);
|
||||
var returnDef = result.GetValue(returnDefOption);
|
||||
var traceAllCalls = result.GetValue(traceAllCallsOption);
|
||||
return await CommandHelpers.ExecuteCommandAsync(
|
||||
result, urlOption, formatOption, usernameOption, passwordOption,
|
||||
new CreateApiMethodCommand(name, script, timeout, parameters, returnDef));
|
||||
new CreateApiMethodCommand(name, script, timeout, parameters, returnDef, traceAllCalls));
|
||||
});
|
||||
return cmd;
|
||||
}
|
||||
@@ -89,6 +95,11 @@ public static class ApiMethodCommands
|
||||
timeoutOption.DefaultValueFactory = _ => 30;
|
||||
var parametersOption = new Option<string?>("--parameters") { Description = "Parameter definitions JSON" };
|
||||
var returnDefOption = new Option<string?>("--return-def") { Description = "Return type definition" };
|
||||
// bool? so an update that omits the flag leaves the stored value unchanged.
|
||||
var traceAllCallsOption = new Option<bool?>("--trace-all-calls")
|
||||
{
|
||||
Description = "Trace every production call to this method for the Flow Debugger (true/false; omitted = unchanged; adds ~7 audit rows per call)"
|
||||
};
|
||||
|
||||
var cmd = new Command("update") { Description = "Update an API method" };
|
||||
cmd.Add(idOption);
|
||||
@@ -96,6 +107,7 @@ public static class ApiMethodCommands
|
||||
cmd.Add(timeoutOption);
|
||||
cmd.Add(parametersOption);
|
||||
cmd.Add(returnDefOption);
|
||||
cmd.Add(traceAllCallsOption);
|
||||
cmd.SetAction(async (ParseResult result) =>
|
||||
{
|
||||
var id = result.GetValue(idOption);
|
||||
@@ -103,9 +115,10 @@ public static class ApiMethodCommands
|
||||
var timeout = result.GetValue(timeoutOption);
|
||||
var parameters = result.GetValue(parametersOption);
|
||||
var returnDef = result.GetValue(returnDefOption);
|
||||
var traceAllCalls = result.GetValue(traceAllCallsOption);
|
||||
return await CommandHelpers.ExecuteCommandAsync(
|
||||
result, urlOption, formatOption, usernameOption, passwordOption,
|
||||
new UpdateApiMethodCommand(id, script, timeout, parameters, returnDef));
|
||||
new UpdateApiMethodCommand(id, script, timeout, parameters, returnDef, traceAllCalls));
|
||||
});
|
||||
return cmd;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user