-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Re-version HTTP request node #3215
Conversation
function getCredPaths(root = NODES_BASE_ROOT): string[] { | ||
const packageJson = require(path.resolve(root, 'package.json')); | ||
|
||
return deduplicate(packageJson.n8n.credentials); |
There was a problem hiding this comment.
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
.
There was a problem hiding this 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; |
There was a problem hiding this comment.
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.
{ | ||
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, | ||
}, |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
Thank you @krynble, comments addressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, LGTM!
Reversioned with #3205, only HTTPRN relevant for review.