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.

25 lines (24 loc) 1.39 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'; import { MicrosoftUser } from '../../entities/microsoft-user.entity'; import { Repository } from 'typeorm'; export declare class EmailService { private readonly microsoftAuthService; private readonly webhookSubscriptionRepository; private readonly eventEmitter; private readonly microsoftConfig; private readonly microsoftUserRepository; private readonly logger; constructor(microsoftAuthService: MicrosoftAuthService, webhookSubscriptionRepository: OutlookWebhookSubscriptionRepository, eventEmitter: EventEmitter2, microsoftConfig: MicrosoftOutlookConfig, microsoftUserRepository: Repository<MicrosoftUser>); sendEmail(message: Partial<Message>, externalUserId: string): Promise<{ message: Message; }>; createWebhookSubscription(externalUserId: string): Promise<Subscription>; handleEmailWebhook(notificationItem: ChangeNotification): Promise<{ success: boolean; message: string; }>; }