mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(core): Add support for pairedItem (beta) (#3012)
* ✨ Add pairedItem support * 👕 Fix lint issue * 🐛 Fix resolution in frontend * 🐛 Fix resolution issue * 🐛 Fix resolution in frontend * 🐛 Fix another resolution issue in frontend * ⚡ Try to automatically add pairedItem data if possible * ⚡ Cleanup * ⚡ Display expression errors in editor UI * 🐛 Fix issue that it did not display errors in production * 🐛 Fix auto-fix of missing pairedItem data * 🐛 Fix frontend resolution for not executed nodes * ⚡ Fail execution on pairedItem resolve issue and display information about itemIndex and runIndex * ⚡ Allow that pairedItem is only set to number if runIndex is 0 * ✨ Improve Expression Errors * ⚡ Remove no longer needed code * ⚡ Make errors more helpful * ⚡ Add additional errors * 👕 Fix lint issue * ⚡ Add pairedItem support to core nodes * ⚡ Improve support in Merge-Node * ⚡ Fix issue with not correctly converted incoming pairedItem data * 🐛 Fix frontend resolve issue * 🐛 Fix frontend parameter name display issue * ⚡ Improve errors * 👕 Fix lint issue * ⚡ Improve errors * ⚡ Make it possible to display parameter name in error messages * ⚡ Improve error messages * ⚡ Fix error message * ⚡ Improve error messages * ⚡ Add another error message * ⚡ Simplify
This commit is contained in:
@@ -259,7 +259,14 @@ export class Git implements INodeType {
|
||||
|
||||
await git.add(pathsToAdd.split(','));
|
||||
|
||||
returnItems.push({ json: { success: true } });
|
||||
returnItems.push({
|
||||
json: {
|
||||
success: true,
|
||||
},
|
||||
pairedItem: {
|
||||
item: itemIndex,
|
||||
},
|
||||
});
|
||||
|
||||
} else if (operation === 'addConfig') {
|
||||
// ----------------------------------
|
||||
@@ -275,7 +282,14 @@ export class Git implements INodeType {
|
||||
}
|
||||
|
||||
await git.addConfig(key, value, append);
|
||||
returnItems.push({ json: { success: true } });
|
||||
returnItems.push({
|
||||
json: {
|
||||
success: true,
|
||||
},
|
||||
pairedItem: {
|
||||
item: itemIndex,
|
||||
},
|
||||
});
|
||||
|
||||
} else if (operation === 'clone') {
|
||||
// ----------------------------------
|
||||
@@ -287,7 +301,14 @@ export class Git implements INodeType {
|
||||
|
||||
await git.clone(sourceRepository, '.');
|
||||
|
||||
returnItems.push({ json: { success: true } });
|
||||
returnItems.push({
|
||||
json: {
|
||||
success: true,
|
||||
},
|
||||
pairedItem: {
|
||||
item: itemIndex,
|
||||
},
|
||||
});
|
||||
|
||||
} else if (operation === 'commit') {
|
||||
// ----------------------------------
|
||||
@@ -303,7 +324,14 @@ export class Git implements INodeType {
|
||||
|
||||
await git.commit(message, pathsToAdd);
|
||||
|
||||
returnItems.push({ json: { success: true } });
|
||||
returnItems.push({
|
||||
json: {
|
||||
success: true,
|
||||
},
|
||||
pairedItem: {
|
||||
item: itemIndex,
|
||||
},
|
||||
});
|
||||
|
||||
} else if (operation === 'fetch') {
|
||||
// ----------------------------------
|
||||
@@ -311,7 +339,14 @@ export class Git implements INodeType {
|
||||
// ----------------------------------
|
||||
|
||||
await git.fetch();
|
||||
returnItems.push({ json: { success: true } });
|
||||
returnItems.push({
|
||||
json: {
|
||||
success: true,
|
||||
},
|
||||
pairedItem: {
|
||||
item: itemIndex,
|
||||
},
|
||||
});
|
||||
|
||||
} else if (operation === 'log') {
|
||||
// ----------------------------------
|
||||
@@ -331,7 +366,12 @@ export class Git implements INodeType {
|
||||
const log = await git.log(logOptions);
|
||||
|
||||
// @ts-ignore
|
||||
returnItems.push(...this.helpers.returnJsonArray(log.all));
|
||||
returnItems.push(...this.helpers.returnJsonArray(log.all).map(item => {
|
||||
return {
|
||||
...item,
|
||||
pairedItem: { item: itemIndex },
|
||||
};
|
||||
}));
|
||||
|
||||
} else if (operation === 'pull') {
|
||||
// ----------------------------------
|
||||
@@ -339,7 +379,14 @@ export class Git implements INodeType {
|
||||
// ----------------------------------
|
||||
|
||||
await git.pull();
|
||||
returnItems.push({ json: { success: true } });
|
||||
returnItems.push({
|
||||
json: {
|
||||
success: true,
|
||||
},
|
||||
pairedItem: {
|
||||
item: itemIndex,
|
||||
},
|
||||
});
|
||||
|
||||
} else if (operation === 'push') {
|
||||
// ----------------------------------
|
||||
@@ -370,7 +417,14 @@ export class Git implements INodeType {
|
||||
}
|
||||
}
|
||||
|
||||
returnItems.push({ json: { success: true } });
|
||||
returnItems.push({
|
||||
json: {
|
||||
success: true,
|
||||
},
|
||||
pairedItem: {
|
||||
item: itemIndex,
|
||||
},
|
||||
});
|
||||
|
||||
} else if (operation === 'pushTags') {
|
||||
// ----------------------------------
|
||||
@@ -378,7 +432,14 @@ export class Git implements INodeType {
|
||||
// ----------------------------------
|
||||
|
||||
await git.pushTags();
|
||||
returnItems.push({ json: { success: true } });
|
||||
returnItems.push({
|
||||
json: {
|
||||
success: true,
|
||||
},
|
||||
pairedItem: {
|
||||
item: itemIndex,
|
||||
},
|
||||
});
|
||||
|
||||
} else if (operation === 'listConfig') {
|
||||
// ----------------------------------
|
||||
@@ -396,7 +457,12 @@ export class Git implements INodeType {
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
returnItems.push(...this.helpers.returnJsonArray(data));
|
||||
returnItems.push(...this.helpers.returnJsonArray(data).map(item => {
|
||||
return {
|
||||
...item,
|
||||
pairedItem: { item: itemIndex },
|
||||
};
|
||||
}));
|
||||
|
||||
} else if (operation === 'status') {
|
||||
// ----------------------------------
|
||||
@@ -406,7 +472,12 @@ export class Git implements INodeType {
|
||||
const status = await git.status();
|
||||
|
||||
// @ts-ignore
|
||||
returnItems.push(...this.helpers.returnJsonArray([status]));
|
||||
returnItems.push(...this.helpers.returnJsonArray([status]).map(item => {
|
||||
return {
|
||||
...item,
|
||||
pairedItem: { item: itemIndex },
|
||||
};
|
||||
}));
|
||||
|
||||
} else if (operation === 'tag') {
|
||||
// ----------------------------------
|
||||
@@ -416,14 +487,27 @@ export class Git implements INodeType {
|
||||
const name = this.getNodeParameter('name', itemIndex, '') as string;
|
||||
|
||||
await git.addTag(name);
|
||||
returnItems.push({ json: { success: true } });
|
||||
|
||||
returnItems.push({
|
||||
json: {
|
||||
success: true,
|
||||
},
|
||||
pairedItem: {
|
||||
item: itemIndex,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
|
||||
if (this.continueOnFail()) {
|
||||
returnItems.push({ json: { error: error.toString() } });
|
||||
returnItems.push({
|
||||
json: {
|
||||
error: error.toString(),
|
||||
},
|
||||
pairedItem: {
|
||||
item: itemIndex,
|
||||
},
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user