Node.js SDKTypes
Document Type Types
Node.js SDK - Document type definitions
DocumentType
A document type definition from the API.
Prop
Type
ValidationErrorInfo
Validation error details.
Prop
Type
ValidationWarningInfo
Validation warning details.
Prop
Type
ValidationResult
Result of validating a document type schema.
Prop
Type
DocumentTypesListParams
Parameters for listing document types.
Prop
Type
Type Guards
isValidationValid(result)
Returns true if the validation result has no errors.
hasValidationWarnings(result)
Returns true if the validation result has warnings.
import { isValidationValid, hasValidationWarnings } from 'docutray';
const result = await client.documentTypes.validate('dt_abc123');
if (isValidationValid(result)) {
console.log('Schema is valid');
if (hasValidationWarnings(result)) {
console.log('Warnings:', result.warnings.messages);
}
}