mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(Wise Node): Add Support to download statements as JSON, CSV or PDF (#3468)
This commit is contained in:
@@ -58,6 +58,10 @@ export async function wiseApiRequest(
|
||||
delete options.qs;
|
||||
}
|
||||
|
||||
if (option.encoding) {
|
||||
delete options.json;
|
||||
}
|
||||
|
||||
if (Object.keys(option)) {
|
||||
Object.assign(options, option);
|
||||
}
|
||||
@@ -112,26 +116,6 @@ export async function wiseApiRequest(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the binary property of node items with binary data for a PDF file.
|
||||
*/
|
||||
export async function handleBinaryData(
|
||||
this: IExecuteFunctions,
|
||||
items: INodeExecutionData[],
|
||||
i: number,
|
||||
endpoint: string,
|
||||
) {
|
||||
const data = await wiseApiRequest.call(this, 'GET', endpoint, {}, {}, { encoding: null });
|
||||
const binaryProperty = this.getNodeParameter('binaryProperty', i) as string;
|
||||
|
||||
items[i].binary = items[i].binary ?? {};
|
||||
items[i].binary![binaryProperty] = await this.helpers.prepareBinaryData(data);
|
||||
items[i].binary![binaryProperty].fileName = this.getNodeParameter('fileName', i) as string;
|
||||
items[i].binary![binaryProperty].fileExtension = 'pdf';
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
export function getTriggerName(eventName: string) {
|
||||
const events: IDataObject = {
|
||||
'tranferStateChange': 'transfers#state-change',
|
||||
|
||||
Reference in New Issue
Block a user