diff --git a/package.json b/package.json index f420232..9c39eb8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@scribelabsai/amazon-trp", - "version": "3.0.2", + "version": "3.0.3", "description": "Amazon Textract Response Parser library for Node.", "type": "module", "types": "./dist/index.d.ts", @@ -59,4 +59,4 @@ "zod": "^3.21.4", "commander": "^11.0.0" } -} +} \ No newline at end of file diff --git a/src/BlockStruct.ts b/src/BlockStruct.ts index 0e80dde..518ffe6 100644 --- a/src/BlockStruct.ts +++ b/src/BlockStruct.ts @@ -21,7 +21,8 @@ const SelectionElementBlockSchema = BlockBaseSchema.extend({ Ids: string().array(), }) .array() - .optional(), + .optional() + .nullable(), SelectionStatus: literal('SELECTED').or(literal('NOT_SELECTED')), }); export type SelectionElementBlock = zinfer; diff --git a/src/Document.ts b/src/Document.ts index 861157e..89ab775 100644 --- a/src/Document.ts +++ b/src/Document.ts @@ -41,7 +41,7 @@ export class Document { const issue = ret.error.issues[0]; if (issue) throw new ParseError( - `${issue?.path}: ${issue?.message} @${ + `${issue?.path}: ${issue.code} - ${issue?.message} @${ typeof issue.path[0] === 'number' ? JSON.stringify(blocks[issue?.path?.[0]]) : '' }` );