UNPKG

nylas

Version:

A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.

112 lines (111 loc) 4.46 kB
import { Overrides } from '../config.js'; import { Calendar, CreateCalenderRequest, ListCalendersQueryParams, UpdateCalenderRequest } from '../models/calendars.js'; import { NylasBaseResponse, NylasResponse, NylasListResponse } from '../models/response.js'; import { Resource, AsyncListResponse } from './resource.js'; import { GetAvailabilityRequest, GetAvailabilityResponse } from '../models/availability.js'; import { GetFreeBusyRequest, GetFreeBusyResponse } from '../models/freeBusy.js'; /** * The parameters for the {@link Calendars.find} method * @property calendarId The id of the Calendar to retrieve. Use "primary" to refer to the primary calendar associated with grant. * @property identifier The identifier of the grant to act upon */ export interface FindCalendarParams { identifier: string; calendarId: string; } /** * The parameters for the {@link Calendars.list} method * @property identifier The identifier of the grant to act upon * @property queryParams The query parameters to include in the request */ export interface ListCalendersParams { identifier: string; queryParams?: ListCalendersQueryParams; } /** * The parameters for the {@link Calendars.create} method * @property identifier The identifier of the grant to act upon * @property requestBody The request body to create a calendar */ export interface CreateCalendarParams { identifier: string; requestBody: CreateCalenderRequest; } /** * The parameters for the {@link Calendars.update} method * @property identifier The identifier of the grant to act upon * @property calendarId The id of the Calendar to retrieve. Use "primary" to refer to the primary calendar associated with grant. */ export interface UpdateCalendarParams { identifier: string; calendarId: string; requestBody: UpdateCalenderRequest; } /** * The parameters for the {@link Calendars.destroy} method * @property identifier The identifier of the grant to act upon * @property calendarId The id of the Calendar to retrieve. Use "primary" to refer to the primary calendar associated with grant. */ export interface DestroyCalendarParams { identifier: string; calendarId: string; } /** * The parameters for the {@link Calendars.getAvailability} method * @property requestBody The availability request */ export interface GetAvailabilityParams { requestBody: GetAvailabilityRequest; } /** * The parameters for the {@link Calendars.getFreeBusy} method * @property identifier The identifier of the grant to act upon * @property requestBody The free busy request */ export interface GetFreeBusyParams { identifier: string; requestBody: GetFreeBusyRequest; } /** * Nylas Calendar API * * The Nylas calendar API allows you to create new calendars or manage existing ones. * A calendar can be accessed by one, or several people, and can contain events. */ export declare class Calendars extends Resource { /** * Return all Calendars * @return A list of calendars */ list({ identifier, queryParams, overrides, }: ListCalendersParams & ListCalendersQueryParams & Overrides): AsyncListResponse<NylasListResponse<Calendar>>; /** * Return a Calendar * @return The calendar */ find({ identifier, calendarId, overrides, }: FindCalendarParams & Overrides): Promise<NylasResponse<Calendar>>; /** * Create a Calendar * @return The created calendar */ create({ identifier, requestBody, overrides, }: CreateCalendarParams & Overrides): Promise<NylasResponse<Calendar>>; /** * Update a Calendar * @return The updated Calendar */ update({ calendarId, identifier, requestBody, overrides, }: UpdateCalendarParams & Overrides): Promise<NylasResponse<Calendar>>; /** * Delete a Calendar * @return The deleted Calendar */ destroy({ identifier, calendarId, overrides, }: DestroyCalendarParams & Overrides): Promise<NylasBaseResponse>; /** * Get Availability for a given account / accounts * @return The availability response */ getAvailability({ requestBody, overrides, }: GetAvailabilityParams & Overrides): Promise<NylasResponse<GetAvailabilityResponse>>; /** * Get the free/busy schedule for a list of email addresses * @return The free/busy response */ getFreeBusy({ identifier, requestBody, overrides, }: GetFreeBusyParams & Overrides): Promise<NylasResponse<GetFreeBusyResponse[]>>; }