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.

27 lines (26 loc) 1.6 kB
import { EventEmitter2 } from '@nestjs/event-emitter'; import { Event, Subscription, ChangeNotification } from '../../types'; import { MicrosoftAuthService } from '../auth/microsoft-auth.service'; import { OutlookWebhookSubscriptionRepository } from '../../repositories/outlook-webhook-subscription.repository'; import { MicrosoftOutlookConfig } from '../../interfaces/config/outlook-config.interface'; export declare class CalendarService { private readonly microsoftAuthService; private readonly webhookSubscriptionRepository; private readonly eventEmitter; private readonly microsoftConfig; private readonly logger; constructor(microsoftAuthService: MicrosoftAuthService, webhookSubscriptionRepository: OutlookWebhookSubscriptionRepository, eventEmitter: EventEmitter2, microsoftConfig: MicrosoftOutlookConfig); getDefaultCalendarId(externalUserId: string): Promise<string>; createEvent(event: Partial<Event>, externalUserId: string, calendarId: string): Promise<{ event: Event; }>; createWebhookSubscription(externalUserId: string): Promise<Subscription>; renewWebhookSubscription(subscriptionId: string, externalUserId: string): Promise<Subscription>; renewWebhookSubscriptionByUserId(subscriptionId: string, internalUserId: number | string): Promise<Subscription>; deleteWebhookSubscription(subscriptionId: string, externalUserId: string): Promise<boolean>; renewSubscriptions(): Promise<void>; handleOutlookWebhook(notificationItem: ChangeNotification): Promise<{ success: boolean; message: string; }>; }