mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
fix(check): tighten lobster and webhook mutation types
This commit is contained in:
@@ -175,8 +175,12 @@ function parseResumeFlowParams(params: Record<string, unknown>): ManagedFlowResu
|
||||
}
|
||||
|
||||
function formatManagedFlowResult(result: ManagedFlowSuccessResult) {
|
||||
const envelope =
|
||||
result.envelope && typeof result.envelope === "object" && !Array.isArray(result.envelope)
|
||||
? result.envelope
|
||||
: { envelope: result.envelope };
|
||||
const details = {
|
||||
...result.envelope,
|
||||
...envelope,
|
||||
flow: result.flow,
|
||||
mutation: result.mutation,
|
||||
};
|
||||
|
||||
@@ -334,15 +334,21 @@ function mapMutationResult(
|
||||
return result;
|
||||
}
|
||||
|
||||
function mapFlowMutationResult(result: {
|
||||
applied: boolean;
|
||||
code: string;
|
||||
flow?: Parameters<typeof toFlowView>[0];
|
||||
current?: Parameters<typeof toFlowView>[0];
|
||||
}): unknown {
|
||||
function mapFlowMutationResult(
|
||||
result:
|
||||
| {
|
||||
applied: true;
|
||||
flow: Parameters<typeof toFlowView>[0];
|
||||
}
|
||||
| {
|
||||
applied: false;
|
||||
code: string;
|
||||
current?: Parameters<typeof toFlowView>[0];
|
||||
},
|
||||
): unknown {
|
||||
return mapMutationResult(
|
||||
result.applied
|
||||
? { applied: true, flow: toFlowView(result.flow!) }
|
||||
? { applied: true, flow: toFlowView(result.flow) }
|
||||
: {
|
||||
applied: false,
|
||||
code: result.code,
|
||||
|
||||
Reference in New Issue
Block a user