Fix package json

This commit is contained in:
Evan Morikawa 2016-06-28 14:07:54 -07:00
parent 8108a875ee
commit 0f4ed7f4a1
7 changed files with 33 additions and 11 deletions

View file

@ -8,11 +8,11 @@
"author": "Nylas",
"license": "ISC",
"dependencies": {
"googleapis": "^9.0.0",
"googleapis": "9.0.0",
"hapi": "13.4.1",
"hapi-auth-basic": "4.2.0",
"hapi-swagger": "6.1.0",
"hapi-boom-decorators": "1.1.3",
"hapi-swagger": "6.1.0",
"inert": "4.0.0",
"joi": "8.4.2",
"nylas-core": "0.x.x",

View file

@ -5,7 +5,8 @@
"main": "index.js",
"dependencies": {
"imap": "0.8.x",
"sqlite3": "3.1.4"
"sqlite3": "3.1.4",
"xoauth2": "1.x.x"
},
"author": "Nylas",
"license": "ISC"

View file

@ -9,9 +9,9 @@
"author": "",
"license": "ISC",
"dependencies": {
"hapi": "^13.4.1",
"hapi-plugin-websocket": "^0.9.2",
"inert": "^4.0.0",
"hapi": "13.4.1",
"hapi-plugin-websocket": "0.9.2",
"inert": "4.0.0",
"nylas-core": "0.x.x"
}
}

View file

@ -9,6 +9,9 @@
"test": "babel-node spec/run.js"
},
"dependencies": {
"babel-cli": "6.10.1",
"babel-preset-es2015": "6.9.0",
"jasmine": "2.4.1",
"mailparser": "0.6.0",
"mimelib": "^0.2.19",
"nylas-core": "0.x.x"

View file

@ -110,13 +110,12 @@ class SyncWorker {
}
syncbackMessageActions() {
return Promise.resolve();
// TODO
const {SyncbackRequest, accountId, Account} = this._db;
return Account.find({where: {id: accountId}}).then((account) => {
return this._db.Account.find({where: {id: accountId}}).then((account) => {
return Promise.each(SyncbackRequest.findAll().then((reqs = []) =>
reqs.map((request) => {
const task = SyncbackTaskFactory.create(account, request);
if (!task) return Promise.reject("No Task")
return this._conn.runOperation(task)
})
));

View file

@ -4,8 +4,13 @@
*/
class SyncbackTaskFactory {
static create(account, syncbackRequest) {
if (account) {
if (syncbackRequest.type === "MoveToFolder") {
// TODO: Know it's IMAP from the account object.
const Task = require('./syncback_tasks/move-to-folder.imap');
return new Task(account, syncbackRequest)
}
return null
}
}
module.exports = SyncbackTaskFactory

View file

@ -0,0 +1,14 @@
class MoveToFolderIMAP {
constructor(account, syncbackRequest) {
this._account = account;
this._syncbackRequest = syncbackRequest;
}
description() {
return `MoveToFolder`;
}
run(db, imap) {
}
}
module.exports = MoveToFolderIMAP