From f7cff0382afc130e511fdc94eaf3b7a215686e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Thu, 5 May 2022 15:06:03 +0200 Subject: [PATCH] :blue_book: Create type for HTTPRN v2 auth params --- .../src/components/mixins/nodeHelpers.ts | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/editor-ui/src/components/mixins/nodeHelpers.ts b/packages/editor-ui/src/components/mixins/nodeHelpers.ts index b188a26007..070a0074c2 100644 --- a/packages/editor-ui/src/components/mixins/nodeHelpers.ts +++ b/packages/editor-ui/src/components/mixins/nodeHelpers.ts @@ -207,11 +207,11 @@ export const nodeHelpers = mixins( let credentialDisplayName: string; let selectedCredentials: INodeCredentialsDetails; - const { authenticateWith, genericAuthType, nodeCredentialType } = node.parameters as { - authenticateWith: 'none' | 'genericAuth' | 'nodeCredential'; - genericAuthType: string; - nodeCredentialType: string; - }; + const { + authenticateWith, + genericAuthType, + nodeCredentialType, + } = node.parameters as HttpRequestNode.V2.AuthParams; if ( 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; + }; + } +}