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.

38 lines (37 loc) 2.41 kB
import { EventEmitter2 } from "@nestjs/event-emitter"; import { Client } from "@microsoft/microsoft-graph-client"; import { Event, Subscription, ChangeNotification } from "../../types"; import { MicrosoftAuthService } from "../auth/microsoft-auth.service"; import { OutlookWebhookSubscriptionRepository } from "../../repositories/outlook-webhook-subscription.repository"; import { OutlookDeltaLinkRepository } from "../../repositories/outlook-delta-link.repository"; import { MicrosoftOutlookConfig } from "../../interfaces/config/outlook-config.interface"; import { MicrosoftUser } from "../../entities/microsoft-user.entity"; import { Repository } from "typeorm"; import { DeltaSyncService } from "../shared/delta-sync.service"; export declare class CalendarService { private readonly microsoftAuthService; private readonly webhookSubscriptionRepository; private readonly eventEmitter; private readonly microsoftConfig; private readonly deltaLinkRepository; private readonly microsoftUserRepository; private readonly deltaSyncService; private readonly logger; constructor(microsoftAuthService: MicrosoftAuthService, webhookSubscriptionRepository: OutlookWebhookSubscriptionRepository, eventEmitter: EventEmitter2, microsoftConfig: MicrosoftOutlookConfig, deltaLinkRepository: OutlookDeltaLinkRepository, microsoftUserRepository: Repository<MicrosoftUser>, deltaSyncService: DeltaSyncService); 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; }>; fetchAndSortChanges(externalUserId: string): Promise<Event[]>; getAuthenticatedClient(externalUserId: string): Promise<Client>; getEventDetails(resource: string, externalUserId: string): Promise<Event | null>; }