feat(editor): Add HTTP request nodes for credentials without a node (#7157)

Github issue / Community forum post (link here to close automatically):

---------

Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Elias Meire
2023-11-13 12:11:16 +01:00
committed by GitHub
parent 460ac85fda
commit 14035e1244
62 changed files with 665 additions and 146 deletions

View File

@@ -17,8 +17,8 @@ export class CredentialTypes implements ICredentialTypes {
return this.getCredential(credentialType).type;
}
getNodeTypesToTestWith(type: string): string[] {
return this.loadNodesAndCredentials.knownCredentials[type]?.nodesToTestWith ?? [];
getSupportedNodes(type: string): string[] {
return this.loadNodesAndCredentials.knownCredentials[type]?.supportedNodes ?? [];
}
/**

View File

@@ -490,8 +490,8 @@ export class CredentialsHelper extends ICredentialsHelper {
};
}
const nodeTypesToTestWith = this.credentialTypes.getNodeTypesToTestWith(credentialType);
for (const nodeName of nodeTypesToTestWith) {
const supportedNodes = this.credentialTypes.getSupportedNodes(credentialType);
for (const nodeName of supportedNodes) {
const node = this.nodeTypes.getByName(nodeName);
// Always set to an array even if node is not versioned to not having

View File

@@ -290,15 +290,15 @@ export class LoadNodesAndCredentials {
const {
className,
sourcePath,
nodesToTestWith,
supportedNodes,
extends: extendsArr,
} = known.credentials[type];
this.known.credentials[type] = {
className,
sourcePath: path.join(directory, sourcePath),
nodesToTestWith:
supportedNodes:
loader instanceof PackageDirectoryLoader
? nodesToTestWith?.map((nodeName) => `${loader.packageName}.${nodeName}`)
? supportedNodes?.map((nodeName) => `${loader.packageName}.${nodeName}`)
: undefined,
extends: extendsArr,
};