Step Types
Type definitions for Step in the DocuTray Node.js SDK — request and response models, fields, and enums.
StepExecutionStatusType
Possible statuses for a step execution.
type StepExecutionStatusType = 'ENQUEUED' | 'PROCESSING' | 'SUCCESS' | 'ERROR';StepExecutionEnqueued
Response of steps.runAsync(): the execution was queued. Pass its id to steps.getStatus(); wait() does it for you.
Prop
Type
StepExecutionStatus
Status of a step execution (steps.getStatus() and wait()). The execution is identified by execution_id, the id that runAsync() returned. validation is a ValidationSummary.
Prop
Type
StepExecutionError
Structured error of a failed execution, in StepExecutionStatus.error.
Prop
Type
StepsRunParams
Parameters for running a step. Provide exactly one of file, url, or base64 as the document source.
Prop
Type
Type Guards
isStepExecutionComplete(status)
Returns true if the step execution has reached a terminal state (SUCCESS or ERROR).
isStepExecutionSuccess(status)
Returns true if the step execution completed successfully.
isStepExecutionError(status)
Returns true if the step execution failed with an error.
import { isStepExecutionSuccess } from 'docutray';
const result = await status.wait();
if (isStepExecutionSuccess(result)) {
console.log('Processed data:', result.data);
}Webhook Types
Type definitions for Webhooks in the DocuTray Node.js SDK — event types and the conversion, identification and step webhook payloads.
Knowledge Base Types
TypeScript types for knowledge bases in the Docutray Node.js SDK — KnowledgeBase, documents, and semantic-search result models with fields and enums.