refactor(core): Fix type errors in workflow, core, nodes-langchain, and nodes-base (no-changelog) (#9450)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-05-22 17:40:52 +02:00
committed by GitHub
parent d9616fc36f
commit 2bdc459bb2
98 changed files with 126 additions and 156 deletions

View File

@@ -7,7 +7,7 @@ import type {
IRequestOptions,
JsonObject,
} from 'n8n-workflow';
import { BINARY_ENCODING, NodeApiError } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
export async function microsoftApiRequest(
this: IExecuteFunctions | ILoadOptionsFunctions,
@@ -222,23 +222,3 @@ export async function downloadAttachments(
}
return elements;
}
export async function binaryToAttachments(
this: IExecuteFunctions,
attachments: IDataObject[],
items: INodeExecutionData[],
i: number,
) {
return await Promise.all(
attachments.map(async (attachment) => {
const binaryPropertyName = attachment.binaryPropertyName as string;
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
return {
'@odata.type': '#microsoft.graph.fileAttachment',
name: binaryData.fileName,
contentBytes: dataBuffer.toString(BINARY_ENCODING),
};
}),
);
}