UNPKG

nylas

Version:

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

93 lines (92 loc) 3.17 kB
import { Overrides } from '../config.js'; import { CreateContactRequest, Contact, ListContactQueryParams, FindContactQueryParams, UpdateContactRequest, ContactGroup } from '../models/contacts.js'; import { NylasResponse, NylasListResponse, NylasBaseResponse } from '../models/response.js'; import { AsyncListResponse, Resource } from './resource.js'; /** * @property contactId The id of the Contact to retrieve. * @property identifier The identifier of the grant to act upon * @property queryParams The query parameters to include in the request */ interface FindContactParams { identifier: string; contactId: string; queryParams: FindContactQueryParams; } /** * @property identifier The identifier of the grant to act upon * @property queryParams The query parameters to include in the request */ interface ListContactParams { identifier: string; queryParams: ListContactQueryParams; } /** * @property identifier The identifier of the grant to act upon * @property requestBody The values to create the Contact with */ interface CreateContactParams { identifier: string; requestBody: CreateContactRequest; } /** * @property identifier The identifier of the grant to act upon * @property contactId The id of the Contact to retrieve. * @property requestBody The values to update the Contact with */ interface UpdateContactParams { identifier: string; contactId: string; requestBody: UpdateContactRequest; } /** * @property identifier The identifier of the grant to act upon * @property contactId The id of the Contact to retrieve. */ interface DestroyContactParams { identifier: string; contactId: string; } /** * @property identifier The identifier of the grant to act upon */ interface ListContactGroupParams { identifier: string; } /** * Nylas Contacts API * * The Nylas Contacts API allows you to create, update, and delete contacts. */ export declare class Contacts extends Resource { /** * Return all Contacts * @return The list of Contacts */ list({ identifier, queryParams, overrides, }: ListContactParams & Overrides): AsyncListResponse<NylasListResponse<Contact>>; /** * Return a Contact * @return The Contact */ find({ identifier, contactId, queryParams, overrides, }: FindContactParams & Overrides): Promise<NylasResponse<Contact>>; /** * Create a Contact * @return The created Contact */ create({ identifier, requestBody, overrides, }: CreateContactParams & Overrides): Promise<NylasResponse<Contact>>; /** * Update a Contact * @return The updated Contact */ update({ identifier, contactId, requestBody, overrides, }: UpdateContactParams & Overrides): Promise<NylasResponse<Contact>>; /** * Delete a Contact * @return The deletion response */ destroy({ identifier, contactId, overrides, }: DestroyContactParams & Overrides): Promise<NylasBaseResponse>; /** * Return a Contact Group * @return The list of Contact Groups */ groups({ identifier, overrides, }: ListContactGroupParams & Overrides): Promise<NylasListResponse<ContactGroup>>; } export {};