-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): Fix populating of node custom api call options (#5347)
* feat(core): Fix populating of node custom api call options * lint fixes * Adress PR comments * Add e2e test and only inject custom API options for latest version * Make sure to injectCustomApiCallOption for the latest version of node * feat(cli): Move apiCallOption injection to LoadNodesAndCredentials and add e2e tests to check for custom nodes credentials * Load nodes and credentials fixtures from a single place * Console warning if credential is invalid during customApiOptions injection
- Loading branch information
1 parent
4dab2fe
commit 6985500
Showing
16 changed files
with
269 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "customE2eCredential", | ||
"displayName": "Custom E2E Credential", | ||
"properties": [{ | ||
"displayName": "API Key", | ||
"name": "apiKey", | ||
"type": "string", | ||
"default": "", | ||
"required": false | ||
}], | ||
"authenticate": { | ||
"type": "generic", | ||
"properties": { | ||
"qs": { | ||
"auth": "={{$credentials.apiKey}}" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"properties": [ | ||
{ | ||
"displayName": "Test property", | ||
"name": "testProp", | ||
"type": "string", | ||
"required": true, | ||
"noDataExpression": false, | ||
"default": "Some default" | ||
}, | ||
{ | ||
"displayName": "Resource", | ||
"name": "resource", | ||
"type": "options", | ||
"noDataExpression": true, | ||
"options": [ | ||
{ | ||
"name": "option1", | ||
"value": "option1" | ||
}, | ||
{ | ||
"name": "option2", | ||
"value": "option2" | ||
}, | ||
{ | ||
"name": "option3", | ||
"value": "option3" | ||
}, | ||
{ | ||
"name": "option4", | ||
"value": "option4" | ||
} | ||
], | ||
"default": "option2" | ||
} | ||
], | ||
"displayName": "E2E Node with custom credential", | ||
"name": "@e2e/n8n-nodes-e2e-custom-credential", | ||
"group": ["transform"], | ||
"codex": { | ||
"categories": ["Custom Category"] | ||
}, | ||
"version": 1, | ||
"description": "Demonstrate rendering of node with custom credential", | ||
"defaults": { | ||
"name": "E2E Node with custom credential" | ||
}, | ||
"inputs": ["main"], | ||
"outputs": ["main"], | ||
"icon": "fa:network-wired", | ||
"credentials": [ | ||
{ | ||
"name": "customE2eCredential", | ||
"required": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"properties": [ | ||
{ | ||
"displayName": "Test property", | ||
"name": "testProp", | ||
"type": "string", | ||
"required": true, | ||
"noDataExpression": false, | ||
"default": "Some default" | ||
}, | ||
{ | ||
"displayName": "Resource", | ||
"name": "resource", | ||
"type": "options", | ||
"noDataExpression": true, | ||
"options": [ | ||
{ | ||
"name": "option1", | ||
"value": "option1" | ||
}, | ||
{ | ||
"name": "option2", | ||
"value": "option2" | ||
}, | ||
{ | ||
"name": "option3", | ||
"value": "option3" | ||
}, | ||
{ | ||
"name": "option4", | ||
"value": "option4" | ||
} | ||
], | ||
"default": "option2" | ||
} | ||
], | ||
"displayName": "E2E Node with native n8n credential", | ||
"name": "@e2e/n8n-nodes-e2e-credential", | ||
"group": ["transform"], | ||
"codex": { | ||
"categories": ["Custom Category"] | ||
}, | ||
"version": 1, | ||
"description": "Demonstrate rendering of node with native credential", | ||
"defaults": { | ||
"name": "E2E Node with native n8n credential" | ||
}, | ||
"inputs": ["main"], | ||
"outputs": ["main"], | ||
"icon": "fa:network-wired", | ||
"credentials": [ | ||
{ | ||
"name": "notionApi", | ||
"required": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.