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
This commit is contained in:
@@ -56,9 +56,12 @@ const customNodeActionsParsers: {
|
||||
},
|
||||
};
|
||||
|
||||
function filterSinglePlaceholderAction(actions: INodeActionTypeDescription[]) {
|
||||
function filterActions(actions: INodeActionTypeDescription[]) {
|
||||
return actions.filter(
|
||||
(action: INodeActionTypeDescription, _: number, arr: INodeActionTypeDescription[]) => {
|
||||
const isApiCall = action.actionKey === CUSTOM_API_CALL_KEY;
|
||||
if (isApiCall) return false;
|
||||
|
||||
const isPlaceholderTriggerAction = action.actionKey === PLACEHOLDER_RECOMMENDED_ACTION_KEY;
|
||||
return !isPlaceholderTriggerAction || (isPlaceholderTriggerAction && arr.length > 1);
|
||||
},
|
||||
@@ -339,7 +342,7 @@ export const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, {
|
||||
|
||||
const filteredNodes = Object.values(mergedNodes).map((node) => ({
|
||||
...node,
|
||||
actions: filterSinglePlaceholderAction(node.actions || []),
|
||||
actions: filterActions(node.actions || []),
|
||||
}));
|
||||
|
||||
return filteredNodes;
|
||||
|
||||
Reference in New Issue
Block a user