nylas
Version:
A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.
74 lines (73 loc) • 3.57 kB
JavaScript
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./models/index.js"), exports);
const apiClient_js_1 = __importDefault(require("./apiClient.js"));
const config_js_1 = require("./config.js");
const calendars_js_1 = require("./resources/calendars.js");
const events_js_1 = require("./resources/events.js");
const auth_js_1 = require("./resources/auth.js");
const webhooks_js_1 = require("./resources/webhooks.js");
const applications_js_1 = require("./resources/applications.js");
const messages_js_1 = require("./resources/messages.js");
const drafts_js_1 = require("./resources/drafts.js");
const threads_js_1 = require("./resources/threads.js");
const connectors_js_1 = require("./resources/connectors.js");
const folders_js_1 = require("./resources/folders.js");
const grants_js_1 = require("./resources/grants.js");
const contacts_js_1 = require("./resources/contacts.js");
const attachments_js_1 = require("./resources/attachments.js");
const scheduler_js_1 = require("./resources/scheduler.js");
const notetakers_js_1 = require("./resources/notetakers.js");
/**
* The entry point to the Node SDK
*
* A Nylas instance holds a configured http client pointing to a base URL and is intended to be reused and shared
* across threads and time.
*/
class Nylas {
/**
* @param config Configuration options for the Nylas SDK
*/
constructor(config) {
this.apiClient = new apiClient_js_1.default({
apiKey: config.apiKey,
apiUri: config.apiUri || config_js_1.DEFAULT_SERVER_URL,
timeout: config.timeout || 90,
headers: config.headers || {},
});
this.applications = new applications_js_1.Applications(this.apiClient);
this.auth = new auth_js_1.Auth(this.apiClient);
this.calendars = new calendars_js_1.Calendars(this.apiClient);
this.connectors = new connectors_js_1.Connectors(this.apiClient);
this.drafts = new drafts_js_1.Drafts(this.apiClient);
this.events = new events_js_1.Events(this.apiClient);
this.grants = new grants_js_1.Grants(this.apiClient);
this.messages = new messages_js_1.Messages(this.apiClient);
this.notetakers = new notetakers_js_1.Notetakers(this.apiClient);
this.threads = new threads_js_1.Threads(this.apiClient);
this.webhooks = new webhooks_js_1.Webhooks(this.apiClient);
this.folders = new folders_js_1.Folders(this.apiClient);
this.contacts = new contacts_js_1.Contacts(this.apiClient);
this.attachments = new attachments_js_1.Attachments(this.apiClient);
this.scheduler = new scheduler_js_1.Scheduler(this.apiClient);
return this;
}
}
exports.default = Nylas;