feat(Email Trigger (IMAP) Node): IMAP trigger node returns message UIDs (#13152)

This commit is contained in:
umanamente
2025-04-08 00:54:59 -07:00
committed by GitHub
parent 7463f0c18a
commit 457870953a
2 changed files with 13 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ describe('Test IMap V2 utils', () => {
const message = {
attributes: {
uuid: 1,
uid: 873,
struct: {},
},
parts: [
@@ -25,7 +26,6 @@ describe('Test IMap V2 utils', () => {
],
};
const staticData: IDataObject = {};
const imapConnection = mock<ImapSimple>({
search: jest.fn().mockReturnValue(Promise.resolve([message])),
});
@@ -42,6 +42,9 @@ describe('Test IMap V2 utils', () => {
headers: { '': 'Body content' },
headerLines: undefined,
html: false,
attributes: {
uid: 873,
},
},
binary: undefined,
},
@@ -55,6 +58,9 @@ describe('Test IMap V2 utils', () => {
metadata: {
'0': 'h',
},
attributes: {
uid: 873,
},
},
},
},
@@ -67,6 +73,9 @@ describe('Test IMap V2 utils', () => {
];
expectedResults.forEach(async (expectedResult) => {
// use new staticData for each iteration
const staticData: IDataObject = {};
triggerFunctions.getNodeParameter
.calledWith('format')
.mockReturnValue(expectedResult.format);

View File

@@ -149,6 +149,9 @@ export async function getNewEmails(
textHtml: await getText(parts, message, 'html'),
textPlain: await getText(parts, message, 'plain'),
metadata: {} as IDataObject,
attributes: {
uid: message.attributes.uid,
} as IDataObject,
},
};