📘 Create type for HTTPRN v2 auth params

This commit is contained in:
Iván Ovejero 2022-05-05 15:06:03 +02:00
parent cf54e6ab07
commit f7cff0382a

View file

@ -207,11 +207,11 @@ export const nodeHelpers = mixins(
let credentialDisplayName: string; let credentialDisplayName: string;
let selectedCredentials: INodeCredentialsDetails; let selectedCredentials: INodeCredentialsDetails;
const { authenticateWith, genericAuthType, nodeCredentialType } = node.parameters as { const {
authenticateWith: 'none' | 'genericAuth' | 'nodeCredential'; authenticateWith,
genericAuthType: string; genericAuthType,
nodeCredentialType: string; nodeCredentialType,
}; } = node.parameters as HttpRequestNode.V2.AuthParams;
if ( if (
this.isHttpRequestNodeV2(node) && this.isHttpRequestNodeV2(node) &&
@ -476,3 +476,13 @@ function reportUnsetCredential(credentialType: ICredentialType) {
}, },
}; };
} }
declare namespace HttpRequestNode {
namespace V2 {
type AuthParams = {
authenticateWith: 'none' | 'genericAuth' | 'nodeCredential';
genericAuthType: string;
nodeCredentialType: string;
};
}
}