mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -323,8 +323,8 @@ export class EmailReadImapV1 implements INodeType {
|
||||
.then(async (partData) => {
|
||||
// Return it in the format n8n expects
|
||||
return this.helpers.prepareBinaryData(
|
||||
partData,
|
||||
attachmentPart.disposition.params.filename,
|
||||
partData as Buffer,
|
||||
attachmentPart.disposition.params.filename as string,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -393,7 +393,7 @@ export class EmailReadImapV1 implements INodeType {
|
||||
}
|
||||
const parsedEmail = await parseRawEmail.call(
|
||||
this,
|
||||
part.body,
|
||||
part.body as Buffer,
|
||||
dataPropertyAttachmentsPrefixName,
|
||||
);
|
||||
|
||||
@@ -437,7 +437,7 @@ export class EmailReadImapV1 implements INodeType {
|
||||
});
|
||||
|
||||
messageBody = messageHeader[0].body;
|
||||
for (propertyName of Object.keys(messageBody)) {
|
||||
for (propertyName of Object.keys(messageBody as IDataObject)) {
|
||||
if (messageBody[propertyName].length) {
|
||||
if (topLevelProperties.includes(propertyName)) {
|
||||
newEmail.json[propertyName] = messageBody[propertyName][0];
|
||||
@@ -579,7 +579,7 @@ export class EmailReadImapV1 implements INodeType {
|
||||
return imapConnect(config).then(async (conn) => {
|
||||
conn.on('error', async (error) => {
|
||||
const errorCode = error.code.toUpperCase();
|
||||
if (['ECONNRESET', 'EPIPE'].includes(errorCode)) {
|
||||
if (['ECONNRESET', 'EPIPE'].includes(errorCode as string)) {
|
||||
Logger.verbose(`IMAP connection was reset (${errorCode}) - reconnecting.`, { error });
|
||||
try {
|
||||
connection = await establishConnection();
|
||||
@@ -591,7 +591,7 @@ export class EmailReadImapV1 implements INodeType {
|
||||
}
|
||||
} else {
|
||||
Logger.error('Email Read Imap node encountered a connection error', { error });
|
||||
this.emitError(error);
|
||||
this.emitError(error as Error);
|
||||
}
|
||||
});
|
||||
return conn;
|
||||
|
||||
@@ -331,8 +331,8 @@ export class EmailReadImapV2 implements INodeType {
|
||||
.then(async (partData) => {
|
||||
// Return it in the format n8n expects
|
||||
return this.helpers.prepareBinaryData(
|
||||
partData,
|
||||
attachmentPart.disposition.params.filename,
|
||||
partData as Buffer,
|
||||
attachmentPart.disposition.params.filename as string,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -401,7 +401,7 @@ export class EmailReadImapV2 implements INodeType {
|
||||
}
|
||||
const parsedEmail = await parseRawEmail.call(
|
||||
this,
|
||||
part.body,
|
||||
part.body as Buffer,
|
||||
dataPropertyAttachmentsPrefixName,
|
||||
);
|
||||
|
||||
@@ -445,7 +445,7 @@ export class EmailReadImapV2 implements INodeType {
|
||||
});
|
||||
|
||||
messageBody = messageHeader[0].body;
|
||||
for (propertyName of Object.keys(messageBody)) {
|
||||
for (propertyName of Object.keys(messageBody as IDataObject)) {
|
||||
if (messageBody[propertyName].length) {
|
||||
if (topLevelProperties.includes(propertyName)) {
|
||||
newEmail.json[propertyName] = messageBody[propertyName][0];
|
||||
@@ -567,7 +567,7 @@ export class EmailReadImapV2 implements INodeType {
|
||||
}
|
||||
},
|
||||
onupdate: async (seqno: number, info) => {
|
||||
Logger.verbose(`Email Read Imap:update ${seqno}`, info);
|
||||
Logger.verbose(`Email Read Imap:update ${seqno}`, info as IDataObject);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -603,7 +603,7 @@ export class EmailReadImapV2 implements INodeType {
|
||||
Logger.verbose(`IMAP connection experienced an error: (${errorCode})`, { error });
|
||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
||||
await closeFunction();
|
||||
this.emitError(error);
|
||||
this.emitError(error as Error);
|
||||
});
|
||||
return conn;
|
||||
});
|
||||
@@ -625,7 +625,7 @@ export class EmailReadImapV2 implements INodeType {
|
||||
connection = await establishConnection();
|
||||
await connection.openBox(mailbox);
|
||||
} catch (error) {
|
||||
Logger.error(error);
|
||||
Logger.error(error as string);
|
||||
} finally {
|
||||
isCurrentlyReconnecting = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user