Comparing version 3.0.0 to 3.0.1
@@ -23,4 +23,4 @@ 'use strict'; | ||
}); | ||
app.use(bodyParser.json()); // support json encoded bodies | ||
app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies | ||
app.use(bodyParser.json({limit: '50000mb'})); // support json encoded bodies | ||
app.use(bodyParser.urlencoded({ limit: '50000mb', extended: true })); // support encoded bodies | ||
@@ -36,2 +36,3 @@ app.get('/webhook', function(req, res) { | ||
app.post('/webhook', function(req, res) { | ||
res.sendStatus(200); | ||
// Verify the request to make sure it's actually from Nylas. | ||
@@ -46,2 +47,3 @@ if (!verify_nylas_request(req)) { | ||
let data = req.body.deltas; | ||
console.log(JSON.stringify(data, null, 2)); | ||
for (var i = 0; i < data.length; i++) { | ||
@@ -54,3 +56,2 @@ // Print some of the information Nylas sent us. This is where you | ||
// Don't forget to let Nylas know that everything was pretty ok. | ||
return res.status(200); | ||
}); | ||
@@ -57,0 +58,0 @@ |
(function() { | ||
var Account, Attributes, Calendar, Contact, Delta, Draft, Event, File, Folder, Label, ManagementAccount, ManagementModelCollection, Message, NylasConnection, Promise, RestfulModel, RestfulModelCollection, RestfulModelInstance, Tag, Thread, _, clone, request; | ||
var Account, Attributes, Calendar, Contact, Delta, Draft, Event, File, Folder, Label, ManagementAccount, ManagementModelCollection, Message, NylasConnection, PACKAGE_JSON, Promise, RestfulModel, RestfulModelCollection, RestfulModelInstance, SDK_VERSION, Tag, Thread, _, clone, request; | ||
@@ -48,2 +48,6 @@ _ = require('underscore'); | ||
PACKAGE_JSON = require('./package.json'); | ||
SDK_VERSION = PACKAGE_JSON.version; | ||
module.exports = NylasConnection = (function() { | ||
@@ -67,3 +71,3 @@ function NylasConnection(accessToken) { | ||
NylasConnection.prototype.requestOptions = function(options) { | ||
var Nylas, ref, user; | ||
var Nylas, base, ref, user; | ||
if (options == null) { | ||
@@ -107,2 +111,9 @@ options = {}; | ||
} | ||
if (options.headers == null) { | ||
options.headers = {}; | ||
} | ||
if ((base = options.headers)['User-Agent'] == null) { | ||
base['User-Agent'] = "Nylas Node SDK v" + SDK_VERSION; | ||
} | ||
console.log(options); | ||
return options; | ||
@@ -109,0 +120,0 @@ }; |
{ | ||
"name": "nylas", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "A NodeJS wrapper for the Nylas REST API for Email, Contacts and Calendar", | ||
@@ -28,2 +28,3 @@ "main": "lib/nylas.js", | ||
"devDependencies": { | ||
"coffeescript": "1.12.6", | ||
"grunt-jasmine-node": "^0.2.1", | ||
@@ -30,0 +31,0 @@ "grunt-jasmine-node-coffee": "^0.1.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
225700
106
2873
6