[Microsoft integration] getFullMessageList (#9544)

Creation of the GmailGetMessageListService
Implementation of the driver to MS Graph API getFullMessageList
This commit is contained in:
Guillim
2025-01-13 10:13:37 +01:00
committed by GitHub
parent c1847054f8
commit 34ee64a36c
7 changed files with 184 additions and 7 deletions

View File

@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import { ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity';
import { GmailGetMessageListService } from 'src/modules/messaging/message-import-manager/drivers/gmail/services/gmail-get-message-list.service';
import { MicrosoftGetMessageListService } from 'src/modules/messaging/message-import-manager/drivers/microsoft/services/microsoft-get-message-list.service';
import {
MessageImportException,
MessageImportExceptionCode,
@ -22,6 +23,7 @@ export type GetPartialMessageListResponse = {
export class MessagingGetMessageListService {
constructor(
private readonly gmailGetMessageListService: GmailGetMessageListService,
private readonly microsoftGetMessageListService: MicrosoftGetMessageListService,
) {}
public async getFullMessageList(
@ -36,11 +38,9 @@ export class MessagingGetMessageListService {
connectedAccount,
);
case 'microsoft':
// TODO: Placeholder
return {
messageExternalIds: [],
nextSyncCursor: '',
};
return this.microsoftGetMessageListService.getFullMessageList(
connectedAccount,
);
default:
throw new MessageImportException(
`Provider ${connectedAccount.provider} is not supported`,