mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 11:37:49 +00:00
fix(check): tighten lobster and webhook mutation types
This commit is contained in:
parent
aa4cb43627
commit
87bcfe796f
2 changed files with 18 additions and 8 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue