UNPKG

@checkfirst/nestjs-outlook

Version:

An opinionated NestJS module for Microsoft Outlook integration that provides easy access to Microsoft Graph API for emails, calendars, and more.

22 lines (21 loc) 1.18 kB
import { EventEmitter2 } from '@nestjs/event-emitter'; import { MicrosoftAuthService } from '../auth/microsoft-auth.service'; import { MicrosoftOutlookConfig } from '../../interfaces/config/outlook-config.interface'; import { Message, ChangeNotification, Subscription } from '@microsoft/microsoft-graph-types'; import { OutlookWebhookSubscriptionRepository } from '../../repositories/outlook-webhook-subscription.repository'; export declare class EmailService { private readonly microsoftAuthService; private readonly webhookSubscriptionRepository; private readonly eventEmitter; private readonly microsoftConfig; private readonly logger; constructor(microsoftAuthService: MicrosoftAuthService, webhookSubscriptionRepository: OutlookWebhookSubscriptionRepository, eventEmitter: EventEmitter2, microsoftConfig: MicrosoftOutlookConfig); sendEmail(message: Partial<Message>, externalUserId: string): Promise<{ message: Message; }>; createWebhookSubscription(externalUserId: string): Promise<Subscription>; handleEmailWebhook(notificationItem: ChangeNotification): Promise<{ success: boolean; message: string; }>; }