[Outlook integration] part 2 : GetMessages (#9612)
### Introducing - mock files in order to setup unit test on parsing outlook messages - special spec files for development purposes : dev.spec files. They are CI skipped with xdescribe but very useful for iterating on new messages format - main functionality : getMessages. We use microsoft default client to do so, using the $batch endpoint to group calls by 20 ### documentation final touch to add troubleshooting tips
This commit is contained in:
@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity';
|
||||
import { GmailGetMessagesService } from 'src/modules/messaging/message-import-manager/drivers/gmail/services/gmail-get-messages.service';
|
||||
import { MicrosoftGetMessagesService } from 'src/modules/messaging/message-import-manager/drivers/microsoft/services/microsoft-get-messages.service';
|
||||
import {
|
||||
MessageImportException,
|
||||
MessageImportExceptionCode,
|
||||
@ -14,6 +15,7 @@ export type GetMessagesResponse = MessageWithParticipants[];
|
||||
export class MessagingGetMessagesService {
|
||||
constructor(
|
||||
private readonly gmailGetMessagesService: GmailGetMessagesService,
|
||||
private readonly microsoftGetMessagesService: MicrosoftGetMessagesService,
|
||||
) {}
|
||||
|
||||
public async getMessages(
|
||||
@ -36,6 +38,12 @@ export class MessagingGetMessagesService {
|
||||
connectedAccount,
|
||||
workspaceId,
|
||||
);
|
||||
case 'microsoft':
|
||||
return this.microsoftGetMessagesService.getMessages(
|
||||
messageIds,
|
||||
connectedAccount,
|
||||
workspaceId,
|
||||
);
|
||||
default:
|
||||
throw new MessageImportException(
|
||||
`Provider ${connectedAccount.provider} is not supported`,
|
||||
|
||||
Reference in New Issue
Block a user