js-bao-wss-client / FunctionInvokeResult
Interface: FunctionInvokeResult<TOutput>
The invoke envelope.
Deliberately without a runId: the request path writes no run row, so there is nothing to look up afterwards. A function that throws or times out is a settled invocation with a terminal status, NOT a transport error — only the platform refusing the call before the code ran (access, disabled, unpushed, rate) is an HTTP error.
Type Parameters
TOutput
TOutput = unknown
Properties
error?
optionalerror?:string
Present when status is "failed" or "timeout".
errorCode?
optionalerrorCode?:string
invocationId?
optionalinvocationId?:string
The invocation-log record this answer belongs to.
Minted before the run, so the record and the answer share it: hand it to primitive functions logs <functionId> --invocation <id> to read what the invocation printed and the error it threw.
Present exactly when the platform recorded the invocation — which is every outcome the function itself produced. Absent from a platform refusal whose record was suppressed, and from a server that predates the field.
limits?
optionallimits?:FunctionInvokeLimits
The ceilings the sandbox ran under.
Present on every outcome the sandbox produced; absent from a refusal that never reached it, which has no run to describe — and those refusals are HTTP errors, so a caller holding this envelope has one.
output?
optionaloutput?:TOutput
Present when status is "completed".
status
status:
FunctionInvokeStatus