Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-version HTTP request node #3215

Merged
merged 9 commits into from
Apr 28, 2022

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Apr 28, 2022

Reversioned with #3205, only HTTPRN relevant for review.

function getCredPaths(root = NODES_BASE_ROOT): string[] {
const packageJson = require(path.resolve(root, 'package.json'));

return deduplicate(packageJson.n8n.credentials);
Copy link
Contributor Author

@ivov ivov Apr 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prevent Vue unique key complaints from duplicates in package.json.

@ivov ivov mentioned this pull request Apr 28, 2022
@ivov ivov added feature Large self-contained feature n8n team Authored by the n8n team labels Apr 28, 2022
Copy link
Contributor

@krynble krynble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ivov looks super solid.

I added some minor comments about how to fetch the node version; all else looks good!

const requestMethod = this.getNodeParameter('requestMethod', 0) as string;
const parametersAreJson = this.getNodeParameter('jsonParameters', 0) as boolean;
let authenticateWith;
let isHttpRequestNodeVersion1 = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use this.getNode().typeVersion instead of trying to fetch a parameter? I am not sure if this would work but it seems to be a safer bet and also a better example for the future.

Comment on lines 27 to 52
{
displayName: 'Display V1',
name: 'versionTest',
type: 'number',
displayOptions: {
show: {
'@version': [
1,
],
},
},
default: 1,
},
{
displayName: 'Display V2',
name: 'versionTest',
type: 'number',
displayOptions: {
show: {
'@version': [
2,
],
},
},
default: 2,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these changes to the Set node can be undone, their purpose was to showcase how this can be used, right?

@@ -187,6 +213,10 @@ export class Set implements INodeType {
}
});


newItem.json.versionFromParameter = this.getNodeParameter('versionTest', itemIndex);
newItem.json.versionFromNode = this.getNode().typeVersion;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an example of what I mentioned about fetching current node version

@ivov
Copy link
Contributor Author

ivov commented Apr 28, 2022

Thank you @krynble, comments addressed.

Copy link
Contributor

@krynble krynble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM!

@alexgrozav alexgrozav merged commit afe3c04 into custom-operations Apr 28, 2022
@alexgrozav alexgrozav deleted the n8n-3481-re-version-http-request-node branch April 28, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Large self-contained feature n8n team Authored by the n8n team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants