mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix: Lazy load nodes for credentials testing (#4760)
This commit is contained in:
committed by
GitHub
parent
3d67df490c
commit
0a7a2f3e41
@@ -2,7 +2,6 @@ import {
|
||||
IAuthenticateGeneric,
|
||||
ICredentialDataDecryptedObject,
|
||||
ICredentialType,
|
||||
ICredentialTypeData,
|
||||
IHttpRequestOptions,
|
||||
INode,
|
||||
INodeProperties,
|
||||
@@ -234,9 +233,13 @@ describe('CredentialsHelper', () => {
|
||||
},
|
||||
};
|
||||
|
||||
CredentialTypes(mockNodesAndCredentials);
|
||||
const credentialTypes = CredentialTypes(mockNodesAndCredentials);
|
||||
|
||||
const credentialsHelper = new CredentialsHelper(TEST_ENCRYPTION_KEY);
|
||||
const credentialsHelper = new CredentialsHelper(
|
||||
TEST_ENCRYPTION_KEY,
|
||||
credentialTypes,
|
||||
nodeTypes,
|
||||
);
|
||||
|
||||
const result = await credentialsHelper.authenticate(
|
||||
testData.input.credentials,
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
INodeType,
|
||||
INodeTypeData,
|
||||
INodeTypes,
|
||||
IVersionedNodeType,
|
||||
NodeHelpers,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
@@ -48,12 +49,8 @@ class NodeTypesClass implements INodeTypes {
|
||||
}
|
||||
}
|
||||
|
||||
getAll(): INodeType[] {
|
||||
return Object.values(this.nodeTypes).map((data) => NodeHelpers.getVersionedNodeType(data.type));
|
||||
}
|
||||
|
||||
getByName(nodeType: string): INodeType {
|
||||
return this.getByNameAndVersion(nodeType);
|
||||
getByName(nodeType: string): INodeType | IVersionedNodeType {
|
||||
return this.nodeTypes[nodeType].type;
|
||||
}
|
||||
|
||||
getByNameAndVersion(nodeType: string, version?: number): INodeType {
|
||||
|
||||
Reference in New Issue
Block a user