Remove EdgehillAPI from auth and fix NylasRequest and perspective

This commit is contained in:
Evan Morikawa 2016-11-23 12:36:38 -08:00
parent 1b5b0bf36a
commit 144fd7f372
4 changed files with 6 additions and 13 deletions

View file

@ -1,7 +1,7 @@
/* eslint global-require: 0 */
import crypto from 'crypto';
import {EdgehillAPI, NylasAPI, AccountStore, RegExpUtils, IdentityStore} from 'nylas-exports';
import {NylasAPI, AccountStore, RegExpUtils, IdentityStore} from 'nylas-exports';
const IMAP_FIELDS = new Set([
"imap_host",
@ -110,15 +110,6 @@ export function runAuthRequest(accountInfo) {
sendImmediately: true,
},
})
.then((json) => {
json.email = data.email;
return EdgehillAPI.makeRequest({
path: "/connect/nylas",
method: "POST",
timeout: 60000,
body: json,
})
})
}
export function isValidHost(value) {

2
src/K2

@ -1 +1 @@
Subproject commit 05874d5d79a7ac24cdd1d5c7a607ff5e5e5d29fa
Subproject commit d7ec67db1830185427c1175d941013be27cd9478

View file

@ -12,7 +12,7 @@ import NylasAPI from './nylas-api'
export default class NylasAPIRequest {
constructor(api, options) {
const defaults = {
url: `${options.APIRoot || options.LocalSyncRoot || api.LocalSyncRoot}${options.path}`,
url: `${options.APIRoot || options.LocalSyncRoot || api.APIRoot || api.LocalSyncRoot}${options.path}`,
method: 'GET',
json: true,
timeout: 15000,

View file

@ -73,7 +73,9 @@ class MailboxPerspective
# Instance Methods
constructor: (@accountIds) ->
unless @accountIds instanceof Array and _.every(@accountIds, _.isString)
unless @accountIds instanceof Array and _.every(@accountIds, (aid) =>
(typeof aid is 'string') or (typeof aid is 'number')
)
throw new Error("#{@constructor.name}: You must provide an array of string `accountIds`")
@