@lautmaler/crm-connectors
Version:
Provides connectors to various CRM systems and calendar services.
109 lines • 3.15 kB
TypeScript
import { Appointment, CRMBackend } from "../crm.interfaces.js";
export declare class GoogleCalendarBackend implements CRMBackend {
private readonly SIPGATE_BASE_URL;
private readonly DEFAULT_TIMEZONE;
private readonly APPOINTMENT_DURATION_MS;
private readonly DEFAULT_DELEGATION_EMAIL;
private logger;
private googleAuth;
private calendarService;
private meetService;
private calendarOwnerId;
private userDelegationEmail;
private googleMeetUrl;
constructor();
/**
* Initialize the logger
*/
private initializeLogger;
/**
* Initialize Google services if not in test environment
*/
private initializeGoogleServices;
/**
* Authenticate with Google services
*/
private initializeGoogleAuth;
/**
* Parse the Google service account credentials
*/
private parseCredentials;
/**
* Set up the Google Calendar service
*/
private setupCalendarService;
/**
* Set up ACL rules for calendar sharing
*/
private setupCalendarAcl;
/**
* Set up the Google Meet service
*/
private setupMeetService;
/**
* Fetch available time slots based on calendar availability
*/
fetchAvailableSlots(timestamp: string, attendees?: string[]): Promise<string[]>;
/**
* Call the FreeBusy API to get busy time slots
*/
private freeBusyApiCall;
/**
* Generate available time slots based on busy times
*/
private generateAvailableSlots;
/**
* Fetch available appointment types
*/
fetchAppointmentTypes(): Promise<string[]>;
/**
* Book a new appointment
*/
bookAppointment(appointment: Appointment): Promise<string>;
/**
* Modify an existing appointment
*/
modifyAppointment(id: string, updatedInfo: Partial<Appointment>): Promise<Appointment>;
/**
* Find an appointment by contact name (email)
*/
findAppointmentByContactName(name: string): Promise<Appointment>;
/**
* Find an appointment by timestamp
*/
findAppointmentByTimestamp(timestamp: string): Promise<Appointment | null>;
/**
* Find an appointment by ID
*/
findAppointmentById(id: string): Promise<Appointment | null>;
/**
* Map a Google Calendar event to an Appointment object
*/
private mapEventToAppointment;
/**
* Create a Google Calendar event
*/
createEvent(appointment: Appointment): Promise<string>;
/**
* Create a conference event with Google Meet
*/
private createConference;
/**
* Create an event and send an SMS notification
*/
createEventToSms(appointment: Appointment): Promise<string>;
/**
* Create a calendar event and send an SMS invitation
*/
createCalendarEventToSms(appointment: Appointment): Promise<string>;
/**
* Format an SMS message for appointment notification
*/
private formatSmsMessage;
/**
* Send an SMS via Sipgate API
*/
private sendSipgateSms;
}
export default GoogleCalendarBackend;
//# sourceMappingURL=GoogleCalendarBackend.d.ts.map