diff --git a/packages/nodes-base/nodes/Ftp/Ftp.node.ts b/packages/nodes-base/nodes/Ftp/Ftp.node.ts index bce2208ba6..6e0ed48ff8 100644 --- a/packages/nodes-base/nodes/Ftp/Ftp.node.ts +++ b/packages/nodes-base/nodes/Ftp/Ftp.node.ts @@ -506,14 +506,9 @@ export class Ftp implements INodeType { let returnItems: INodeExecutionData[] = []; const operation = this.getNodeParameter('operation', 0); - let credentials: ICredentialDataDecryptedObject | undefined = undefined; const protocol = this.getNodeParameter('protocol', 0) as string; + const credentials = await this.getCredentials(protocol === 'sftp' ? 'sftp' : 'ftp'); - if (protocol === 'sftp') { - credentials = await this.getCredentials('sftp'); - } else { - credentials = await this.getCredentials('ftp'); - } let ftp: ftpClient; let sftp: sftpClient; diff --git a/packages/nodes-base/tsconfig.build.json b/packages/nodes-base/tsconfig.build.json index 3a26457c9c..13213ea163 100644 --- a/packages/nodes-base/tsconfig.build.json +++ b/packages/nodes-base/tsconfig.build.json @@ -5,6 +5,7 @@ "tsBuildInfoFile": "dist/build.tsbuildinfo" }, "include": [ + "types.d.ts", "credentials/**/*.ts", "nodes/**/*.ts", "nodes/**/*.json", diff --git a/packages/nodes-base/utils/CredentialSchema.ts b/packages/nodes-base/utils/CredentialSchema.ts index 453aceade4..a8b8e2ebc1 100644 --- a/packages/nodes-base/utils/CredentialSchema.ts +++ b/packages/nodes-base/utils/CredentialSchema.ts @@ -24,7 +24,7 @@ class CredentialSchemaRootObject< S extends ZodType | null, T extends { [k: string]: CredentialSchemaProperty } = {}, > { - constructor(private shape: T) {} + constructor(public shape: T) {} validate(data: Data) { return this.toZodSchema().safeParse(data);