fix(AWS Textract Node): Handle all binary data modes correctly (#19258)

Co-authored-by: jeanpaul <jeanpaul@users.noreply.github.com>
Co-authored-by: Roman Davydchuk <roman.davydchuk@n8n.io>
This commit is contained in:
Shireen Missi
2025-09-18 17:48:30 +02:00
committed by GitHub
parent 5bf3db5ba8
commit 64fa0ceea6
3 changed files with 400 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import {
BINARY_ENCODING,
NodeConnectionTypes,
type ICredentialDataDecryptedObject,
type ICredentialsDecrypted,
@@ -117,11 +118,13 @@ export class AwsTextract implements INodeType {
if (operation === 'analyzeExpense') {
const simple = this.getNodeParameter('simple', i) as boolean;
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
const binaryBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
// Convert the binary buffer to a base64 string
const binaryData = Buffer.from(binaryBuffer).toString(BINARY_ENCODING);
const body: IDataObject = {
Document: {
Bytes: binaryData.data,
Bytes: binaryData,
},
};