mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix: Add paired item to the most used nodes (#5220)
* PairedItem for N8n training * Add paired item to ftp node * Add paired item to rocketChat * Add pairedItem to pushOver * Add paired item to Matrix * Add pairedItem to theHive * Add paired item to Snowflake * Add paired item to PhilipsHue * Add pairedItem to supabase * Add paired item to Odoo * fix odoo & add paired item to grist * add pairedItem to Linkedin * add pairedItem Zulip * add pairedItem PhatomBuster * add pairedItem to TodoistV2 * Add pairedItem HomeAssistant * Add pairedItem to DropContact * Add pairedItem to Aws SES * Add pairedItem to microsoftOutlook * Add pairedItem to AwsS3 * Add pairedItem to Aws DynamoDB * 🐛 fix Dropcontact enrich operation paired item support * 🐛 fix Dropcontact insert/update operation paired items * 🐛 fix Supabase paired item support * 🐛 fix Supabase paired item support * 🐛 fix N8nTrainingCustomerDatastore paired item support * 🎨 remove unused imports * 🐛 fix MicrosoftOutlook paired item support * 🐛 fix AwsS3 paired item support --------- Co-authored-by: Marcus <marcus@n8n.io>
This commit is contained in:
@@ -12,7 +12,6 @@ import type {
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
@@ -84,7 +83,7 @@ export class AwsS3 implements INodeType {
|
||||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
const returnData: IDataObject[] = [];
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
const qs: IDataObject = {};
|
||||
let responseData;
|
||||
const resource = this.getNodeParameter('resource', 0);
|
||||
@@ -150,8 +149,11 @@ export class AwsS3 implements INodeType {
|
||||
qs,
|
||||
headers,
|
||||
);
|
||||
|
||||
returnData.push({ success: true });
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ success: true }),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
|
||||
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html
|
||||
@@ -167,7 +169,11 @@ export class AwsS3 implements INodeType {
|
||||
{},
|
||||
headers,
|
||||
);
|
||||
returnData.push({ success: true });
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ success: true }),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
|
||||
//https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html
|
||||
@@ -194,7 +200,11 @@ export class AwsS3 implements INodeType {
|
||||
);
|
||||
responseData = responseData.slice(0, qs.limit);
|
||||
}
|
||||
returnData.push.apply(returnData, responseData);
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
|
||||
//https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html
|
||||
@@ -263,11 +273,11 @@ export class AwsS3 implements INodeType {
|
||||
);
|
||||
responseData = responseData.ListBucketResult.Contents;
|
||||
}
|
||||
if (Array.isArray(responseData)) {
|
||||
returnData.push.apply(returnData, responseData);
|
||||
} else {
|
||||
returnData.push(responseData);
|
||||
}
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
}
|
||||
if (resource === 'folder') {
|
||||
@@ -306,7 +316,11 @@ export class AwsS3 implements INodeType {
|
||||
{},
|
||||
region,
|
||||
);
|
||||
returnData.push({ success: true });
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ success: true }),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
//https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html
|
||||
if (operation === 'delete') {
|
||||
@@ -386,7 +400,11 @@ export class AwsS3 implements INodeType {
|
||||
|
||||
responseData = { deleted: responseData.DeleteResult.Deleted };
|
||||
}
|
||||
returnData.push(responseData);
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
//https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html
|
||||
if (operation === 'getAll') {
|
||||
@@ -446,7 +464,11 @@ export class AwsS3 implements INodeType {
|
||||
if (qs.limit) {
|
||||
responseData = responseData.splice(0, qs.limit as number);
|
||||
}
|
||||
returnData.push.apply(returnData, responseData);
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -554,7 +576,11 @@ export class AwsS3 implements INodeType {
|
||||
{},
|
||||
region,
|
||||
);
|
||||
returnData.push(responseData.CopyObjectResult);
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData.CopyObjectResult),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
//https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html
|
||||
if (operation === 'download') {
|
||||
@@ -647,8 +673,11 @@ export class AwsS3 implements INodeType {
|
||||
{},
|
||||
region,
|
||||
);
|
||||
|
||||
returnData.push({ success: true });
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ success: true }),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
//https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html
|
||||
if (operation === 'getAll') {
|
||||
@@ -710,7 +739,11 @@ export class AwsS3 implements INodeType {
|
||||
if (qs.limit) {
|
||||
responseData = responseData.splice(0, qs.limit as number);
|
||||
}
|
||||
returnData.push.apply(returnData, responseData);
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
}
|
||||
//https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html
|
||||
@@ -863,12 +896,20 @@ export class AwsS3 implements INodeType {
|
||||
region,
|
||||
);
|
||||
}
|
||||
returnData.push({ success: true });
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ success: true }),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
returnData.push({ error: (error as JsonObject).message });
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ error: error.message }),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
continue;
|
||||
}
|
||||
throw error;
|
||||
@@ -878,7 +919,7 @@ export class AwsS3 implements INodeType {
|
||||
// For file downloads the files get attached to the existing items
|
||||
return this.prepareOutputData(items);
|
||||
} else {
|
||||
return [this.helpers.returnJsonArray(returnData)];
|
||||
return this.prepareOutputData(returnData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user