From a46eb5ab0773285dadf412679fec7a6393ad8989 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sat, 9 Jun 2018 20:42:12 +0900 Subject: [PATCH 1/2] Use megalodon instead of mastodon-api as mastodon api client in main process --- package-lock.json | 89 +++++++++++++++++++++++++++++++++++++++++-- package.json | 1 + src/main/account.js | 32 ++++++++-------- src/main/auth.js | 28 +++++++------- src/main/streaming.js | 8 ++-- 5 files changed, 121 insertions(+), 37 deletions(-) diff --git a/package-lock.json b/package-lock.json index daf9ef5867..fdd7aa27d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,11 +42,42 @@ "dev": true, "optional": true }, + "@types/caseless": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.1.tgz", + "integrity": "sha512-FhlMa34NHp9K5MY1Uz8yb+ZvuX0pnvn3jScRSNAb75KHGB8d3rEU6hqMs3Z2vjuytcMfRg6c5CHMc3wtYyD2/A==" + }, + "@types/form-data": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", + "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", + "requires": { + "@types/node": "8.9.4" + } + }, "@types/node": { "version": "8.9.4", "resolved": "https://registry.npmjs.org/@types/node/-/node-8.9.4.tgz", - "integrity": "sha512-dSvD36qnQs78G1BPsrZFdPpvLgMW/dnvr5+nTW2csMs5TiP9MOXrjUbnMZOEwnIuBklXtn7b6TPA2Cuq07bDHA==", - "dev": true + "integrity": "sha512-dSvD36qnQs78G1BPsrZFdPpvLgMW/dnvr5+nTW2csMs5TiP9MOXrjUbnMZOEwnIuBklXtn7b6TPA2Cuq07bDHA==" + }, + "@types/oauth": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@types/oauth/-/oauth-0.9.0.tgz", + "integrity": "sha512-1oouefxKPGiDkb5m6lNxDkFry3PItCOJ+tlNtEn/gRvWShb2Rb3y0pccOIGwN/AwHUpwsuwlRwSpg7aoCN3bQQ==", + "requires": { + "@types/node": "8.9.4" + } + }, + "@types/request": { + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.47.0.tgz", + "integrity": "sha512-/KXM5oev+nNCLIgBjkwbk8VqxmzI56woD4VUxn95O+YeQ8hJzcSmIZ1IN3WexiqBb6srzDo2bdMbsXxgXNkz5Q==", + "requires": { + "@types/caseless": "0.12.1", + "@types/form-data": "2.2.1", + "@types/node": "8.9.4", + "@types/tough-cookie": "2.3.3" + } }, "@types/tapable": { "version": "1.0.0", @@ -54,6 +85,11 @@ "integrity": "sha512-DrV8VQDeDAJwWqiV+QceN4EHKd3scPPYiwrXr476y7T+2hMoOaH43NVGoaDM3siCz69h/1vMabKaMgMF539qFQ==", "dev": true }, + "@types/tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha512-MDQLxNFRLasqS4UlkWMSACMKeSm1x4Q3TxzUC7KQUsh6RK1ZrQ0VEyE3yzXcBu+K8ejVj4wuX32eUG02yNp+YQ==" + }, "@types/uglify-js": { "version": "2.6.30", "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-2.6.30.tgz", @@ -7800,7 +7836,7 @@ }, "onetime": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" }, "pluralize": { @@ -10702,6 +10738,48 @@ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, + "megalodon": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/megalodon/-/megalodon-0.1.0.tgz", + "integrity": "sha512-4PjAXECAdZgbsWYkErN8bSHHpQ9fBiBoBTZ0riDIUWYBQTVdZq5zNZsU4TcO1ypvAkiWC5CS+2brjFbQcRcXXg==", + "requires": { + "@types/oauth": "0.9.0", + "@types/request": "2.47.0", + "axios": "0.18.0", + "oauth": "0.9.15", + "request": "2.87.0", + "typescript": "2.9.1" + }, + "dependencies": { + "request": { + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", + "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.2", + "har-validator": "5.0.3", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.18", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.1", + "safe-buffer": "5.1.1", + "tough-cookie": "2.3.4", + "tunnel-agent": "0.6.0", + "uuid": "3.2.1" + } + } + } + }, "mem": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", @@ -15914,6 +15992,11 @@ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, + "typescript": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.1.tgz", + "integrity": "sha512-h6pM2f/GDchCFlldnriOhs1QHuwbnmj6/v7499eMHqPeW4V2G0elua2eIc2nu8v2NdHV0Gm+tzX83Hr6nUFjQA==" + }, "uglify-js": { "version": "3.3.16", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.16.tgz", diff --git a/package.json b/package.json index 6d678f1653..92744eb050 100644 --- a/package.json +++ b/package.json @@ -97,6 +97,7 @@ "hoek": "^5.0.3", "is-empty": "^1.2.0", "mastodon-api": "github:h3poteto/mastodon-api#lib", + "megalodon": "^0.1.0", "moment": "^2.21.0", "mousetrap": "^1.6.2", "nedb": "^1.8.0", diff --git a/src/main/account.js b/src/main/account.js index 5d2341d9c1..cdd7837641 100644 --- a/src/main/account.js +++ b/src/main/account.js @@ -1,5 +1,5 @@ import empty from 'is-empty' -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' export default class Account { constructor (db) { @@ -167,21 +167,23 @@ export default class Account { refresh (account) { return new Promise((resolve, reject) => { const client = new Mastodon( - { - access_token: account.accessToken, - api_url: account.baseURL + '/api/v1' - } + account.accessToken, + account.baseURL + '/api/v1' ) - client.get('/accounts/verify_credentials', (err, data, res) => { - if (err) return reject(err) - const json = { - username: data.username, - accountId: data.id, - avatar: data.avatar - } - this.updateAccount(account._id, json) - .then(ac => resolve(ac)) - }) + client.get('/accounts/verify_credentials') + .then(data => { + console.log(data) + const json = { + username: data.username, + accountId: data.id, + avatar: data.avatar + } + this.updateAccount(account._id, json) + .then(ac => resolve(ac)) + }) + .catch(err => { + return reject(err) + }) }) } } diff --git a/src/main/auth.js b/src/main/auth.js index d90af3c5a8..c7fe9cd64b 100644 --- a/src/main/auth.js +++ b/src/main/auth.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const appName = 'Whalebird' const appURL = 'https://whalebird.org' @@ -23,15 +23,15 @@ export default class Authentication { async getAuthorizationUrl (domain = 'mastodon.social') { this.setOtherInstance(domain) - const res = await Mastodon.createOAuthApp( - this.baseURL + '/api/v1/apps', - appName, - scope, - 'urn:ietf:wg:oauth:2.0:oob', - appURL + const res = await Mastodon.registerApp( + appName, { + scopes: scope, + website: appURL + }, + this.baseURL ) - this.clientId = res.client_id - this.clientSecret = res.client_secret + this.clientId = res.clientId + this.clientSecret = res.clientSecret const count = await this.db.countAuthorizedAccounts() const json = { @@ -46,12 +46,11 @@ export default class Authentication { order: count + 1 } await this.db.insertAccount(json) - const url = await Mastodon.getAuthorizationUrl(this.clientId, this.clientSecret, this.baseURL) - return url + return res.url } async getAccessToken (code) { - const token = await Mastodon.getAccessToken(this.clientId, this.clientSecret, code, this.baseURL) + const token = await Mastodon.fetchAccessToken(this.clientId, this.clientSecret, code, this.baseURL) const search = { baseURL: this.baseURL, domain: this.domain, @@ -59,8 +58,9 @@ export default class Authentication { clientSecret: this.clientSecret } const rec = await this.db.searchAccount(search) - await this.db.updateAccount(rec._id, { accessToken: token }) - return token + const accessToken = token.access_token + await this.db.updateAccount(rec._id, { accessToken: accessToken }) + return accessToken } // TODO: Refresh access token when expired } diff --git a/src/main/streaming.js b/src/main/streaming.js index f7994894a2..3c1de4eedf 100644 --- a/src/main/streaming.js +++ b/src/main/streaming.js @@ -1,14 +1,12 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' import log from 'electron-log' export default class Streaming { constructor (account) { this.account = account this.client = new Mastodon( - { - access_token: account.accessToken, - api_url: account.baseURL + '/api/v1' - } + account.accessToken, + account.baseURL + '/api/v1' ) this.listener = null } From 5d549618ee3b66d3929acb8b5720ef5dec1c978f Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sun, 10 Jun 2018 12:25:39 +0900 Subject: [PATCH 2/2] Use megalodon instead of mastodon-api as mastodon api client in render process --- package-lock.json | 762 ++++-------------- package.json | 1 - src/main/account.js | 33 +- .../TimelineSpace/Contents/Cards/Toot.js | 90 +-- .../TimelineSpace/Contents/Favourites.js | 57 +- .../TimelineSpace/Contents/Hashtag/Tag.js | 47 +- .../store/TimelineSpace/Contents/Home.js | 50 +- .../store/TimelineSpace/Contents/Lists.js | 47 +- .../store/TimelineSpace/Contents/Local.js | 50 +- .../TimelineSpace/Contents/Notifications.js | 50 +- .../store/TimelineSpace/Contents/Public.js | 49 +- .../TimelineSpace/Contents/Search/Account.js | 25 +- .../Contents/SideBar/AccountProfile.js | 87 +- .../SideBar/AccountProfile/Followers.js | 21 +- .../SideBar/AccountProfile/Follows.js | 21 +- .../SideBar/AccountProfile/Timeline.js | 51 +- .../Contents/SideBar/TootDetail.js | 19 +- .../store/TimelineSpace/HeaderMenu.js | 20 +- .../store/TimelineSpace/Modals/NewToot.js | 62 +- src/renderer/store/TimelineSpace/SideMenu.js | 20 +- 20 files changed, 519 insertions(+), 1043 deletions(-) diff --git a/package-lock.json b/package-lock.json index fdd7aa27d2..5fdcdc84e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -148,7 +148,8 @@ "acorn": { "version": "5.5.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.1.tgz", - "integrity": "sha512-D/KGiCpM/VOtTMDS+wfjywEth926WUrArrzYov4N4SI7t+3y8747dPpCmmAvrm/Z3ygqMHnyPxvYYO0yTdn/nQ==" + "integrity": "sha512-D/KGiCpM/VOtTMDS+wfjywEth926WUrArrzYov4N4SI7t+3y8747dPpCmmAvrm/Z3ygqMHnyPxvYYO0yTdn/nQ==", + "dev": true }, "acorn-dynamic-import": { "version": "2.0.2", @@ -171,6 +172,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, "requires": { "acorn": "3.3.0" }, @@ -178,7 +180,8 @@ "acorn": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=" + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true } } }, @@ -340,14 +343,6 @@ "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", "dev": true }, - "ansi-gray": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", - "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", - "requires": { - "ansi-wrap": "0.1.0" - } - }, "ansi-html": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", @@ -357,17 +352,14 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" - }, - "ansi-wrap": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=" + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true }, "anymatch": { "version": "1.3.2", @@ -461,6 +453,7 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, "requires": { "sprintf-js": "1.0.3" } @@ -489,7 +482,8 @@ "array-differ": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=" + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true }, "array-find-index": { "version": "1.0.2", @@ -523,6 +517,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, "requires": { "array-uniq": "1.0.3" } @@ -530,7 +525,8 @@ "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true }, "array-unique": { "version": "0.2.1", @@ -547,7 +543,8 @@ "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true }, "asar": { "version": "0.14.3", @@ -743,6 +740,7 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, "requires": { "chalk": "1.1.3", "esutils": "2.0.2", @@ -753,6 +751,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, "requires": { "ansi-styles": "2.2.1", "escape-string-regexp": "1.0.5", @@ -1993,11 +1992,6 @@ "tweetnacl": "0.14.5" } }, - "beeper": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", - "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=" - }, "better-assert": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", @@ -2371,14 +2365,6 @@ "integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s=", "dev": true }, - "bufferstreams": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/bufferstreams/-/bufferstreams-1.1.3.tgz", - "integrity": "sha512-HaJnVuslRF4g2kSDeyl++AaVizoitCpL9PglzCYwy0uHHyvWerfvEb8jWmYbF1z4kiVFolGomnxSGl+GUQp2jg==", - "requires": { - "readable-stream": "2.3.5" - } - }, "builder-util": { "version": "5.7.10", "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-5.7.10.tgz", @@ -2566,6 +2552,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, "requires": { "callsites": "0.2.0" } @@ -2579,7 +2566,8 @@ "callsites": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=" + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true }, "camel-case": { "version": "3.0.0", @@ -2891,7 +2879,8 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==" + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true }, "clap": { "version": "1.2.3", @@ -3039,7 +3028,8 @@ "cli-width": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true }, "cliui": { "version": "4.1.0", @@ -3088,7 +3078,8 @@ "clone": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", - "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=" + "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", + "dev": true }, "clone-deep": { "version": "2.0.2", @@ -3119,11 +3110,6 @@ } } }, - "clone-stats": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", - "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=" - }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -3147,7 +3133,8 @@ "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true }, "collection-visit": { "version": "1.0.0", @@ -3194,11 +3181,6 @@ "color-name": "1.1.3" } }, - "color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" - }, "colormin": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/colormin/-/colormin-1.1.2.tgz", @@ -3338,6 +3320,7 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.1.tgz", "integrity": "sha512-gslSSJx03QKa59cIKqeJO9HQ/WZMotvYJCuaUULrLpjj8oG40kV2Z+gz82pVxlTkOADi4PJxQPPfhl1ELYrrXw==", + "dev": true, "requires": { "inherits": "2.0.3", "readable-stream": "2.3.5", @@ -3883,6 +3866,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, "requires": { "es5-ext": "0.10.39" } @@ -4013,7 +3997,8 @@ "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true }, "deepmerge": { "version": "2.0.1", @@ -4453,6 +4438,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, "requires": { "esutils": "2.0.2" } @@ -4572,37 +4558,6 @@ "dev": true, "optional": true }, - "duplexer2": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", - "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", - "requires": { - "readable-stream": "1.1.14" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - } - } - }, "duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", @@ -5525,6 +5480,7 @@ "version": "0.10.39", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.39.tgz", "integrity": "sha512-AlaXZhPHl0po/uxMx1tyrlt1O86M6D5iVaDH8UgLfgek4kXTX6vzsRfJQWC2Ku+aG8pkw1XWzh9eTkwfVrsD5g==", + "dev": true, "requires": { "es6-iterator": "2.0.3", "es6-symbol": "3.1.1" @@ -5534,6 +5490,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.39", @@ -5544,6 +5501,7 @@ "version": "0.1.5", "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.39", @@ -5572,6 +5530,7 @@ "version": "0.1.5", "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.39", @@ -5584,6 +5543,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.39" @@ -5603,6 +5563,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.39", @@ -5619,7 +5580,8 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true }, "escodegen": { "version": "1.8.1", @@ -5656,6 +5618,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", + "dev": true, "requires": { "es6-map": "0.1.5", "es6-weak-map": "2.0.2", @@ -6025,6 +5988,7 @@ "version": "3.5.4", "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, "requires": { "acorn": "5.5.1", "acorn-jsx": "3.0.1" @@ -6033,12 +5997,14 @@ "esprima": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true }, "esquery": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, "requires": { "estraverse": "4.2.0" } @@ -6047,6 +6013,7 @@ "version": "4.2.1", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, "requires": { "estraverse": "4.2.0" } @@ -6054,12 +6021,14 @@ "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true }, "etag": { "version": "1.8.1", @@ -6071,6 +6040,7 @@ "version": "0.3.5", "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.39" @@ -6125,7 +6095,8 @@ "exit-hook": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=" + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true }, "expand-braces": { "version": "0.1.2", @@ -6389,23 +6360,6 @@ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, - "fancy-log": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz", - "integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=", - "requires": { - "ansi-gray": "0.1.1", - "color-support": "1.1.3", - "time-stamp": "1.1.0" - }, - "dependencies": { - "time-stamp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", - "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=" - } - } - }, "fast-deep-equal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", @@ -6419,7 +6373,8 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true }, "fastparse": { "version": "1.1.1", @@ -6458,6 +6413,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, "requires": { "flat-cache": "1.3.0", "object-assign": "4.1.1" @@ -6554,6 +6510,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, "requires": { "circular-json": "0.3.3", "del": "2.2.2", @@ -6565,6 +6522,7 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, "requires": { "globby": "5.0.0", "is-path-cwd": "1.0.0", @@ -6579,6 +6537,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, "requires": { "array-union": "1.0.2", "arrify": "1.0.1", @@ -6591,7 +6550,8 @@ "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true } } }, @@ -7434,12 +7394,14 @@ "generate-function": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=" + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "dev": true }, "generate-object-property": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, "requires": { "is-property": "1.0.2" } @@ -7630,7 +7592,8 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true }, "globby": { "version": "7.1.1", @@ -7657,14 +7620,6 @@ "minimatch": "3.0.4" } }, - "glogg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz", - "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==", - "requires": { - "sparkles": "1.0.1" - } - }, "got": { "version": "6.7.1", "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", @@ -7701,287 +7656,6 @@ "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", "dev": true }, - "gulp-eslint": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/gulp-eslint/-/gulp-eslint-3.0.1.tgz", - "integrity": "sha1-BOV+PhjGl0JnwSz2hV3HF9SjE70=", - "requires": { - "bufferstreams": "1.1.3", - "eslint": "3.19.0", - "gulp-util": "3.0.8" - }, - "dependencies": { - "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, - "ajv-keywords": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=" - }, - "ansi-escapes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=" - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } - }, - "cli-cursor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", - "requires": { - "restore-cursor": "1.0.1" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "eslint": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", - "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", - "requires": { - "babel-code-frame": "6.26.0", - "chalk": "1.1.3", - "concat-stream": "1.6.1", - "debug": "2.6.9", - "doctrine": "2.1.0", - "escope": "3.6.0", - "espree": "3.5.4", - "esquery": "1.0.0", - "estraverse": "4.2.0", - "esutils": "2.0.2", - "file-entry-cache": "2.0.0", - "glob": "7.1.2", - "globals": "9.18.0", - "ignore": "3.3.7", - "imurmurhash": "0.1.4", - "inquirer": "0.12.0", - "is-my-json-valid": "2.17.2", - "is-resolvable": "1.1.0", - "js-yaml": "3.7.0", - "json-stable-stringify": "1.0.1", - "levn": "0.3.0", - "lodash": "4.17.5", - "mkdirp": "0.5.1", - "natural-compare": "1.4.0", - "optionator": "0.8.2", - "path-is-inside": "1.0.2", - "pluralize": "1.2.1", - "progress": "1.1.8", - "require-uncached": "1.0.3", - "shelljs": "0.7.8", - "strip-bom": "3.0.0", - "strip-json-comments": "2.0.1", - "table": "3.8.3", - "text-table": "0.2.0", - "user-home": "2.0.0" - } - }, - "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", - "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" - } - }, - "inquirer": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", - "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", - "requires": { - "ansi-escapes": "1.4.0", - "ansi-regex": "2.1.1", - "chalk": "1.1.3", - "cli-cursor": "1.0.2", - "cli-width": "2.2.0", - "figures": "1.7.0", - "lodash": "4.17.5", - "readline2": "1.0.1", - "run-async": "0.1.0", - "rx-lite": "3.1.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "through": "2.3.8" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, - "onetime": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" - }, - "pluralize": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", - "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=" - }, - "progress": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=" - }, - "restore-cursor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", - "requires": { - "exit-hook": "1.1.1", - "onetime": "1.1.0" - } - }, - "run-async": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", - "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", - "requires": { - "once": "1.4.0" - } - }, - "rx-lite": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", - "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=" - }, - "slice-ansi": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=" - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" - }, - "table": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", - "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", - "requires": { - "ajv": "4.11.8", - "ajv-keywords": "1.5.1", - "chalk": "1.1.3", - "lodash": "4.17.5", - "slice-ansi": "0.0.4", - "string-width": "2.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "3.0.0" - } - } - } - } - } - }, - "gulp-util": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", - "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", - "requires": { - "array-differ": "1.0.0", - "array-uniq": "1.0.3", - "beeper": "1.1.1", - "chalk": "1.1.3", - "dateformat": "2.2.0", - "fancy-log": "1.3.2", - "gulplog": "1.0.0", - "has-gulplog": "0.1.0", - "lodash._reescape": "3.0.0", - "lodash._reevaluate": "3.0.0", - "lodash._reinterpolate": "3.0.0", - "lodash.template": "3.6.2", - "minimist": "1.2.0", - "multipipe": "0.1.2", - "object-assign": "3.0.0", - "replace-ext": "0.0.1", - "through2": "2.0.3", - "vinyl": "0.5.3" - }, - "dependencies": { - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } - }, - "dateformat": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", - "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=" - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=" - } - } - }, - "gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", - "requires": { - "glogg": "1.0.1" - } - }, "handle-thing": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", @@ -8111,6 +7785,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, "requires": { "ansi-regex": "2.1.1" } @@ -8144,14 +7819,6 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "has-gulplog": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", - "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", - "requires": { - "sparkles": "1.0.1" - } - }, "has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", @@ -8616,7 +8283,8 @@ "ignore": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", - "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==" + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "dev": true }, "immediate": { "version": "3.0.6", @@ -8642,7 +8310,8 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true }, "in-publish": { "version": "2.0.0", @@ -8773,7 +8442,8 @@ "interpret": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", - "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=" + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true }, "invariant": { "version": "2.2.3", @@ -8968,6 +8638,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, "requires": { "number-is-nan": "1.0.1" } @@ -9003,12 +8674,14 @@ "is-my-ip-valid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", - "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==" + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", + "dev": true }, "is-my-json-valid": { "version": "2.17.2", "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", + "dev": true, "requires": { "generate-function": "2.0.0", "generate-object-property": "1.2.0", @@ -9058,12 +8731,14 @@ "is-path-cwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", - "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=" + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true }, "is-path-in-cwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, "requires": { "is-path-inside": "1.0.1" } @@ -9072,6 +8747,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, "requires": { "path-is-inside": "1.0.2" } @@ -9119,7 +8795,8 @@ "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=" + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "dev": true }, "is-redirect": { "version": "1.0.0", @@ -9139,7 +8816,8 @@ "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==" + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true }, "is-retry-allowed": { "version": "1.1.0", @@ -9203,7 +8881,8 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true }, "isbinaryfile": { "version": "3.0.2", @@ -9453,12 +9132,14 @@ "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true }, "js-yaml": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.7.0.tgz", "integrity": "sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=", + "dev": true, "requires": { "argparse": "1.0.10", "esprima": "2.7.3" @@ -9492,14 +9173,6 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "requires": { - "jsonify": "0.0.0" - } - }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -9531,15 +9204,11 @@ "graceful-fs": "4.1.11" } }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" - }, "jsonpointer": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=" + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "dev": true }, "jsprim": { "version": "1.4.1", @@ -9775,6 +9444,7 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, "requires": { "prelude-ls": "1.1.2", "type-check": "0.3.2" @@ -9970,7 +9640,8 @@ "lodash._basecopy": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=" + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true }, "lodash._basefor": { "version": "3.0.3", @@ -9978,16 +9649,6 @@ "integrity": "sha1-dVC06SGO8J+tJDQ7YSAhx5tMIMI=", "dev": true }, - "lodash._basetostring": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", - "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=" - }, - "lodash._basevalues": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", - "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=" - }, "lodash._bindcallback": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", @@ -10008,32 +9669,14 @@ "lodash._getnative": { "version": "3.9.1", "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true }, "lodash._isiterateecall": { "version": "3.0.9", "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=" - }, - "lodash._reescape": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", - "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=" - }, - "lodash._reevaluate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", - "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=" - }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=" - }, - "lodash._root": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", - "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=" + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true }, "lodash.assign": { "version": "4.2.0", @@ -10057,14 +9700,6 @@ "lodash._bindcallback": "3.0.1" } }, - "lodash.escape": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", - "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", - "requires": { - "lodash._root": "3.0.1" - } - }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", @@ -10074,12 +9709,14 @@ "lodash.isarguments": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true }, "lodash.isarray": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true }, "lodash.isplainobject": { "version": "4.0.6", @@ -10097,6 +9734,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, "requires": { "lodash._getnative": "3.9.1", "lodash.isarguments": "3.1.0", @@ -10160,7 +9798,8 @@ "lodash.restparam": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", - "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=" + "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", + "dev": true }, "lodash.some": { "version": "4.6.0", @@ -10174,31 +9813,6 @@ "integrity": "sha1-0jM6NtnncXyK0vfKyv7HwytERmQ=", "dev": true }, - "lodash.template": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", - "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", - "requires": { - "lodash._basecopy": "3.0.1", - "lodash._basetostring": "3.0.1", - "lodash._basevalues": "3.0.0", - "lodash._isiterateecall": "3.0.9", - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0", - "lodash.keys": "3.1.2", - "lodash.restparam": "3.6.1", - "lodash.templatesettings": "3.1.1" - } - }, - "lodash.templatesettings": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", - "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", - "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0" - } - }, "lodash.toplainobject": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lodash.toplainobject/-/lodash.toplainobject-3.0.0.tgz", @@ -10670,23 +10284,6 @@ "object-visit": "1.0.1" } }, - "mastodon-api": { - "version": "github:h3poteto/mastodon-api#c567f019c8f1ffa19b21d73be183c9ceedac4d78", - "requires": { - "gulp-eslint": "3.0.1", - "mime": "1.6.0", - "oauth": "0.9.15", - "readline": "1.3.0", - "request": "2.85.0" - }, - "dependencies": { - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - } - } - }, "math-expression-evaluator": { "version": "1.2.17", "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz", @@ -11159,14 +10756,6 @@ "minimatch": "3.0.4" } }, - "multipipe": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", - "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", - "requires": { - "duplexer2": "0.0.2" - } - }, "multispinner": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/multispinner/-/multispinner-0.2.1.tgz", @@ -11271,7 +10860,8 @@ "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true }, "ncname": { "version": "1.0.0", @@ -11835,7 +11425,8 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true }, "oauth": { "version": "0.9.15", @@ -11850,7 +11441,8 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true }, "object-assign-deep": { "version": "0.4.0", @@ -12162,6 +11754,7 @@ "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, "requires": { "deep-is": "0.1.3", "fast-levenshtein": "2.0.6", @@ -12201,7 +11794,8 @@ "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true }, "os-locale": { "version": "2.1.0", @@ -12469,7 +12063,8 @@ "path-is-inside": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true }, "path-key": { "version": "2.0.1", @@ -12480,7 +12075,8 @@ "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true }, "path-proxy": { "version": "1.0.0", @@ -12565,12 +12161,14 @@ "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, "requires": { "pinkie": "2.0.4" } @@ -13178,7 +12776,8 @@ "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true }, "prepend-http": { "version": "1.0.4", @@ -13233,7 +12832,8 @@ "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true }, "progress": { "version": "2.0.0", @@ -13662,6 +13262,7 @@ "version": "2.3.5", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", + "dev": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", @@ -13684,28 +13285,6 @@ "set-immediate-shim": "1.0.1" } }, - "readline": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/readline/-/readline-1.3.0.tgz", - "integrity": "sha1-xYDXfvLPyHUrEySYBg3JeTp6wBw=" - }, - "readline2": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", - "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "mute-stream": "0.0.5" - }, - "dependencies": { - "mute-stream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", - "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=" - } - } - }, "recast": { "version": "0.11.23", "resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz", @@ -13726,14 +13305,6 @@ } } }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "requires": { - "resolve": "1.5.0" - } - }, "redent": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", @@ -14014,11 +13585,6 @@ "is-finite": "1.0.2" } }, - "replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=" - }, "request": { "version": "2.85.0", "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", @@ -14141,6 +13707,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, "requires": { "caller-path": "0.1.0", "resolve-from": "1.0.1" @@ -14156,6 +13723,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, "requires": { "path-parse": "1.0.5" } @@ -14180,7 +13748,8 @@ "resolve-from": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=" + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true }, "resolve-url": { "version": "0.2.1", @@ -14679,16 +14248,6 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, - "shelljs": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", - "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", - "requires": { - "glob": "7.1.2", - "interpret": "1.1.0", - "rechoir": "0.6.2" - } - }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", @@ -15143,11 +14702,6 @@ "integrity": "sha1-fsrxO1e80J2opAxdJp2zN5nUqvk=", "dev": true }, - "sparkles": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", - "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==" - }, "spdx-correct": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", @@ -15271,7 +14825,8 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true }, "sshpk": { "version": "1.14.1", @@ -15463,6 +15018,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, "requires": { "code-point-at": "1.1.0", "is-fullwidth-code-point": "1.0.0", @@ -15473,6 +15029,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, "requires": { "safe-buffer": "5.1.1" } @@ -15486,6 +15043,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, "requires": { "ansi-regex": "2.1.1" } @@ -15553,7 +15111,8 @@ "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true }, "svgo": { "version": "0.7.2", @@ -15698,7 +15257,8 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true }, "throttle-debounce": { "version": "1.0.1", @@ -15714,12 +15274,14 @@ "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true }, "through2": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, "requires": { "readable-stream": "2.3.5", "xtend": "4.0.1" @@ -15967,6 +15529,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, "requires": { "prelude-ls": "1.1.2" } @@ -15990,7 +15553,8 @@ "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true }, "typescript": { "version": "2.9.1", @@ -16522,14 +16086,6 @@ } } }, - "user-home": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", - "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", - "requires": { - "os-homedir": "1.0.2" - } - }, "useragent": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.2.1.tgz", @@ -16574,7 +16130,8 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true }, "utila": { "version": "0.4.0", @@ -16638,16 +16195,6 @@ "extsprintf": "1.3.0" } }, - "vinyl": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", - "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", - "requires": { - "clone": "1.0.3", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - }, "vm-browserify": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", @@ -18249,7 +17796,8 @@ "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true }, "wrap-ansi": { "version": "2.1.0", @@ -18270,6 +17818,7 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, "requires": { "mkdirp": "0.5.1" } @@ -18336,7 +17885,8 @@ "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true }, "y18n": { "version": "4.0.0", diff --git a/package.json b/package.json index 92744eb050..bab57f37ae 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,6 @@ "hawk": "^7.0.7", "hoek": "^5.0.3", "is-empty": "^1.2.0", - "mastodon-api": "github:h3poteto/mastodon-api#lib", "megalodon": "^0.1.0", "moment": "^2.21.0", "mousetrap": "^1.6.2", diff --git a/src/main/account.js b/src/main/account.js index cdd7837641..8c4af4a83f 100644 --- a/src/main/account.js +++ b/src/main/account.js @@ -165,26 +165,19 @@ export default class Account { } refresh (account) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - account.accessToken, - account.baseURL + '/api/v1' - ) - client.get('/accounts/verify_credentials') - .then(data => { - console.log(data) - const json = { - username: data.username, - accountId: data.id, - avatar: data.avatar - } - this.updateAccount(account._id, json) - .then(ac => resolve(ac)) - }) - .catch(err => { - return reject(err) - }) - }) + const client = new Mastodon( + account.accessToken, + account.baseURL + '/api/v1' + ) + return client.get('/accounts/verify_credentials') + .then(data => { + const json = { + username: data.username, + accountId: data.id, + avatar: data.avatar + } + return this.updateAccount(account._id, json) + }) } } diff --git a/src/renderer/store/TimelineSpace/Contents/Cards/Toot.js b/src/renderer/store/TimelineSpace/Contents/Cards/Toot.js index 65c2b2d8a2..6c903081a2 100644 --- a/src/renderer/store/TimelineSpace/Contents/Cards/Toot.js +++ b/src/renderer/store/TimelineSpace/Contents/Cards/Toot.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' import { ipcRenderer } from 'electron' const Toot = { @@ -7,79 +7,53 @@ const Toot = { mutations: {}, actions: { reblog ({ state, commit, rootState }, message) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.post(`/statuses/${message.id}/reblog`, {}, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.post(`/statuses/${message.id}/reblog`) + .then(data => { // API returns new status when reblog. // Reblog target status is in the data.reblog. // So I send data.reblog as status for update local timeline. ipcRenderer.send('fav-rt-action-sound') - resolve(data.reblog) + return data.reblog }) - }) }, unreblog ({ state, commit, rootState }, message) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.post(`/statuses/${message.id}/unreblog`, {}, (err, data, res) => { - if (err) return reject(err) - resolve(data) - }) - }) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.post(`/statuses/${message.id}/unreblog`) }, addFavourite ({ state, commit, rootState }, message) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.post(`/statuses/${message.id}/favourite`, {}, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.post(`/statuses/${message.id}/favourite`) + .then(data => { ipcRenderer.send('fav-rt-action-sound') - resolve(data) + return data }) - }) }, removeFavourite ({ state, commit, rootState }, message) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.post(`/statuses/${message.id}/unfavourite`, {}, (err, data, res) => { - if (err) return reject(err) - resolve(data) - }) - }) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.post(`/statuses/${message.id}/unfavourite`) }, deleteToot ({ state, commit, rootState }, message) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.delete(`/statuses/${message.id}`, {}, (err, data, res) => { - if (err) return reject(err) - resolve(message) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.del(`/statuses/${message.id}`) + .then(() => { + return message }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/Favourites.js b/src/renderer/store/TimelineSpace/Contents/Favourites.js index 592e552b6b..48c19d1bd2 100644 --- a/src/renderer/store/TimelineSpace/Contents/Favourites.js +++ b/src/renderer/store/TimelineSpace/Contents/Favourites.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const Favourites = { namespaced: true, @@ -44,44 +44,41 @@ const Favourites = { }, actions: { fetchFavourites ({ commit }, account) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: account.accessToken, - api_url: account.baseURL + '/api/v1' - } - ) - client.get('/favourites', { limit: 40 }, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + account.accessToken, + account.baseURL + '/api/v1' + ) + return client.get('/favourites', { limit: 40 }) + .then(data => { commit('updateFavourites', data) - resolve(res) + return data }) - }) }, lazyFetchFavourites ({ state, commit, rootState }, last) { if (last === undefined || last === null) { - return null + return Promise.resolve(null) } - return new Promise((resolve, reject) => { - if (state.lazyLoading) { - return resolve() - } - commit('changeLazyLoading', true) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - // Note: Now this API's explanation and implementation are reversed. - // So if the bug has resolved, please use max_id instead of since_id. - // https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#favourites - client.get('/favourites', { since_id: last.id, limit: 40 }, (err, data, res) => { - if (err) return reject(err) + if (state.lazyLoading) { + return Promise.resolve(null) + } + commit('changeLazyLoading', true) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + // Note: Now this API's explanation and implementation are reversed. + // So if the bug has resolved, please use max_id instead of since_id. + // https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#favourites + return client.get('/favourites', { since_id: last.id, limit: 40 }) + .then(data => { + commit('changeLazyLoading', false) commit('insertFavourites', data) + return data + }) + .catch(err => { commit('changeLazyLoading', false) - resolve(res) + throw err }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js b/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js index 9b1cd5808b..91df8f8dd8 100644 --- a/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js +++ b/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js @@ -1,5 +1,5 @@ import { ipcRenderer } from 'electron' -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const Tag = { namespaced: true, @@ -68,19 +68,14 @@ const Tag = { }, actions: { fetch ({ commit, rootState }, tag) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.get(`/timelines/tag/${tag}`, { limit: 40 }, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get(`/timelines/tag/${tag}`, { limit: 40 }) + .then(data => { commit('updateTimeline', data) - resolve(res) }) - }) }, startStreaming ({ state, commit, rootState }, tag) { ipcRenderer.on('update-start-tag-streaming', (event, update) => { @@ -108,22 +103,24 @@ const Tag = { }) }, lazyFetchTimeline ({ state, commit, rootState }, obj) { - return new Promise((resolve, reject) => { - if (state.lazyLoading) { - return resolve() - } - commit('changeLazyLoading', true) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get(`/timelines/tag/${obj.tag}`, { max_id: obj.last.id, limit: 40 }, (err, data, res) => { - if (err) return reject(err) + if (state.lazyLoading) { + return Promise.resolve(null) + } + commit('changeLazyLoading', true) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get(`/timelines/tag/${obj.tag}`, { max_id: obj.last.id, limit: 40 }) + .then(data => { commit('insertTimeline', data) commit('changeLazyLoading', false) + return data + }) + .catch(err => { + commit('changeLazyLoading', false) + throw err }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/Home.js b/src/renderer/store/TimelineSpace/Contents/Home.js index edf281ec76..21b6ac11d7 100644 --- a/src/renderer/store/TimelineSpace/Contents/Home.js +++ b/src/renderer/store/TimelineSpace/Contents/Home.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const Home = { namespaced: true, @@ -68,40 +68,38 @@ const Home = { }, actions: { fetchTimeline ({ state, commit, rootState }, account) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.get('/timelines/home', { limit: 40 }, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get('/timelines/home', { limit: 40 }) + .then(data => { commit('updateTimeline', data) - resolve(res) + return data }) - }) }, lazyFetchTimeline ({ state, commit, rootState }, last) { if (last === undefined || last === null) { - return null + return Promise.resolve(null) } - return new Promise((resolve, reject) => { - if (state.lazyLoading) { - return resolve() - } - commit('changeLazyLoading', true) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get('/timelines/home', { max_id: last.id, limit: 40 }, (err, data, res) => { + if (state.lazyLoading) { + return Promise.resolve(null) + } + commit('changeLazyLoading', true) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get('/timelines/home', { max_id: last.id, limit: 40 }) + .then(data => { commit('changeLazyLoading', false) - if (err) return reject(err) commit('insertTimeline', data) + return data + }) + .catch(err => { + commit('changeLazyLoading', false) + throw err }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/Lists.js b/src/renderer/store/TimelineSpace/Contents/Lists.js index 445cfabfef..834c7352a1 100644 --- a/src/renderer/store/TimelineSpace/Contents/Lists.js +++ b/src/renderer/store/TimelineSpace/Contents/Lists.js @@ -1,5 +1,5 @@ import { ipcRenderer } from 'electron' -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const Lists = { namespaced: true, @@ -68,18 +68,15 @@ const Lists = { }, actions: { fetchTimeline ({ state, commit, rootState }, listID) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get(`/timelines/list/${listID}`, { limit: 40 }, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get(`/timelines/list/${listID}`, { limit: 40 }) + .then(data => { commit('updateTimeline', data) - resolve(res) + return data }) - }) }, startStreaming ({ state, commit, rootState }, listID) { ipcRenderer.on('update-start-list-streaming', (event, update) => { @@ -107,22 +104,24 @@ const Lists = { }) }, lazyFetchTimeline ({ state, commit, rootState }, obj) { - return new Promise((resolve, reject) => { - if (state.lazyLoading) { - return resolve() - } - commit('changeLazyLoading', true) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get(`/timelines/list/${obj.list_id}`, { max_id: obj.last.id, limit: 40 }, (err, data, res) => { - if (err) return reject(err) + if (state.lazyLoading) { + return Promise.resolve(null) + } + commit('changeLazyLoading', true) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get(`/timelines/list/${obj.list_id}`, { max_id: obj.last.id, limit: 40 }) + .then(data => { commit('insertTimeline', data) commit('changeLazyLoading', false) + return data + }) + .catch(err => { + commit('changeLazyLoading', false) + throw err }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/Local.js b/src/renderer/store/TimelineSpace/Contents/Local.js index e7cf72671b..2d7f25a533 100644 --- a/src/renderer/store/TimelineSpace/Contents/Local.js +++ b/src/renderer/store/TimelineSpace/Contents/Local.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const Local = { namespaced: true, @@ -67,40 +67,38 @@ const Local = { }, actions: { fetchLocalTimeline ({ commit }, account) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: account.accessToken, - api_url: account.baseURL + '/api/v1' - } - ) - client.get('/timelines/public', { limit: 40, local: true }, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + account.accessToken, + account.baseURL + '/api/v1' + ) + return client.get('/timelines/public', { limit: 40, local: true }) + .then(data => { commit('updateTimeline', data) - resolve(res) + return data }) - }) }, lazyFetchTimeline ({ state, commit, rootState }, last) { if (last === undefined || last === null) { - return null + return Promise.resolve(null) } - return new Promise((resolve, reject) => { - if (state.lazyLoading) { - return resolve() - } - commit('changeLazyLoading', true) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get('/timelines/public', { max_id: last.id, limit: 40, local: true }, (err, data, res) => { - if (err) return reject(err) + if (state.lazyLoading) { + return Promise.resolve(null) + } + commit('changeLazyLoading', true) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get('/timelines/public', { max_id: last.id, limit: 40, local: true }) + .then(data => { + commit('changeLazyLoading', false) commit('insertTimeline', data) + return data + }) + .catch(err => { commit('changeLazyLoading', false) + throw err }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/Notifications.js b/src/renderer/store/TimelineSpace/Contents/Notifications.js index 9755101446..2d2b9a29ea 100644 --- a/src/renderer/store/TimelineSpace/Contents/Notifications.js +++ b/src/renderer/store/TimelineSpace/Contents/Notifications.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const Notifications = { namespaced: true, @@ -55,40 +55,38 @@ const Notifications = { }, actions: { fetchNotifications ({ commit }, account) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: account.accessToken, - api_url: account.baseURL + '/api/v1' - } - ) - client.get('/notifications', { limit: 30 }, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + account.accessToken, + account.baseURL + '/api/v1' + ) + return client.get('/notifications', { limit: 30 }) + .then(data => { commit('updateNotifications', data) - resolve(res) + return data }) - }) }, lazyFetchNotifications ({ state, commit, rootState }, last) { if (last === undefined || last === null) { - return null + return Promise.resolve(null) } - return new Promise((resolve, reject) => { - if (state.lazyLoading) { - return resolve() - } - commit('changeLazyLoading', true) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get('/notifications', { max_id: last.id, limit: 30 }, (err, data, res) => { - if (err) return reject(err) + if (state.lazyLoading) { + return Promise.resolve(null) + } + commit('changeLazyLoading', true) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get('/notifications', { max_id: last.id, limit: 30 }) + .then(data => { + commit('changeLazyLoading', false) commit('insertNotifications', data) + return data + }) + .catch(err => { commit('changeLazyLoading', false) + throw err }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/Public.js b/src/renderer/store/TimelineSpace/Contents/Public.js index 8d54c1314c..13a4cab314 100644 --- a/src/renderer/store/TimelineSpace/Contents/Public.js +++ b/src/renderer/store/TimelineSpace/Contents/Public.js @@ -1,5 +1,5 @@ import { ipcRenderer } from 'electron' -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const Public = { namespaced: true, @@ -68,19 +68,14 @@ const Public = { }, actions: { fetchPublicTimeline ({ state, commit, rootState }) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.get('/timelines/public', { limit: 40 }, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get('/timelines/public', { limit: 40 }) + .then(data => { commit('updateTimeline', data) - resolve(res) }) - }) }, startPublicStreaming ({ state, commit, rootState }) { ipcRenderer.on('update-start-public-streaming', (event, update) => { @@ -103,24 +98,26 @@ const Public = { }, lazyFetchTimeline ({ state, commit, rootState }, last) { if (last === undefined || last === null) { - return null + return Promise.resolve(null) } - return new Promise((resolve, reject) => { - if (state.lazyLoading) { - return resolve() - } - commit('changeLazyLoading', true) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get('/timelines/public', { max_id: last.id, limit: 40 }, (err, data, res) => { - if (err) return reject(err) + if (state.lazyLoading) { + return Promise.resolve(null) + } + commit('changeLazyLoading', true) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get('/timelines/public', { max_id: last.id, limit: 40 }) + .then(data => { commit('insertTimeline', data) commit('changeLazyLoading', false) + return data + }) + .catch(err => { + commit('changeLazyLoading', false) + throw err }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/Search/Account.js b/src/renderer/store/TimelineSpace/Contents/Search/Account.js index 5d7ba1266a..23aa99c34d 100644 --- a/src/renderer/store/TimelineSpace/Contents/Search/Account.js +++ b/src/renderer/store/TimelineSpace/Contents/Search/Account.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const Account = { namespaced: true, @@ -12,20 +12,21 @@ const Account = { }, actions: { search ({ state, commit, rootState }, query) { - return new Promise((resolve, reject) => { - commit('TimelineSpace/Contents/Search/changeLoading', true, { root: true }) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get('/search', { q: query }, (err, data, res) => { - if (err) return reject(err) + commit('TimelineSpace/Contents/Search/changeLoading', true, { root: true }) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get('/search', { q: query }) + .then(data => { commit('updateResults', data.accounts) commit('TimelineSpace/Contents/Search/changeLoading', false, { root: true }) - resolve(res) + return data + }) + .catch(err => { + commit('TimelineSpace/Contents/Search/changeLoading', false, { root: true }) + throw err }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile.js b/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile.js index 85b0bbf675..c20bd25dea 100644 --- a/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile.js +++ b/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' import Timeline from './AccountProfile/Timeline' import Follows from './AccountProfile/Follows' import Followers from './AccountProfile/Followers' @@ -28,70 +28,65 @@ const AccountProfile = { }, actions: { searchAccount ({ commit, rootState }, accountURL) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.get('/search', { q: accountURL }, (err, data, res) => { - if (err) return reject(err) - if (data.accounts.length <= 0) return reject(new AccountNotFound('not found')) - resolve(data.accounts[0]) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get('/search', { q: accountURL }) + .then(data => { + if (data.accounts.length <= 0) throw new AccountNotFound('not found') + return data.accounts[0] }) - }) }, changeAccount ({ commit, dispatch }, account) { dispatch('fetchRelationship', account) commit('changeAccount', account) }, fetchRelationship ({ state, commit, rootState }, account) { - return new Promise((resolve, reject) => { - commit('changeRelationship', null) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get('/accounts/relationships', { id: [account.id] }, (err, data, res) => { - if (err) return reject(err) + commit('changeRelationship', null) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get('/accounts/relationships', { id: [account.id] }) + .then(data => { commit('changeRelationship', data[0]) - resolve(res) + return data }) - }) }, follow ({ state, commit, rootState }, account) { - return new Promise((resolve, reject) => { - commit('changeLoading', true) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.post(`/accounts/${account.id}/follow`, {}, (err, data, res) => { + commit('changeLoading', true) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.post(`/accounts/${account.id}/follow`) + .then(data => { commit('changeLoading', false) - if (err) return reject(err) commit('changeRelationship', data) - resolve(res) + return data + }) + .catch(err => { + commit('changeLoading', false) + throw err }) - }) }, unfollow ({ state, commit, rootState }, account) { - return new Promise((resolve, reject) => { - commit('changeLoading', true) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.post(`/accounts/${account.id}/unfollow`, {}, (err, data, res) => { + commit('changeLoading', true) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.post(`/accounts/${account.id}/unfollow`) + .then(data => { commit('changeLoading', false) - if (err) return reject(err) commit('changeRelationship', data) - resolve(res) + return data + }) + .catch(err => { + commit('changeLoading', false) + throw err }) - }) }, close ({ commit }) { commit('changeAccount', null) diff --git a/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Followers.js b/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Followers.js index 638bf3c7f0..e7fce8cced 100644 --- a/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Followers.js +++ b/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Followers.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const Followers = { namespaced: true, @@ -12,20 +12,17 @@ const Followers = { }, actions: { fetchFollowers ({ state, commit, rootState }, account) { - return new Promise((resolve, reject) => { - commit('TimelineSpace/Contents/SideBar/AccountProfile/changeLoading', true, { root: true }) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get(`/accounts/${account.id}/followers`, { limit: 80 }, (err, data, res) => { - if (err) return reject(err) + commit('TimelineSpace/Contents/SideBar/AccountProfile/changeLoading', true, { root: true }) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get(`/accounts/${account.id}/followers`, { limit: 80 }) + .then(data => { commit('TimelineSpace/Contents/SideBar/AccountProfile/changeLoading', false, { root: true }) commit('updateFollowers', data) - resolve(res) + return data }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Follows.js b/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Follows.js index c8ac379886..ab67541306 100644 --- a/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Follows.js +++ b/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Follows.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const Follows = { namespaced: true, @@ -12,20 +12,17 @@ const Follows = { }, actions: { fetchFollows ({ state, commit, rootState }, account) { - return new Promise((resolve, reject) => { - commit('TimelineSpace/Contents/SideBar/AccountProfile/changeLoading', true, { root: true }) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get(`/accounts/${account.id}/following`, { limit: 80 }, (err, data, res) => { - if (err) return reject(err) + commit('TimelineSpace/Contents/SideBar/AccountProfile/changeLoading', true, { root: true }) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get(`/accounts/${account.id}/following`, { limit: 80 }) + .then(data => { commit('TimelineSpace/Contents/SideBar/AccountProfile/changeLoading', false, { root: true }) commit('updateFollows', data) - resolve(res) + return data }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Timeline.js b/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Timeline.js index 6a9c25760a..7c8d7dc343 100644 --- a/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Timeline.js +++ b/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile/Timeline.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const Timeline = { namespaced: true, @@ -45,42 +45,41 @@ const Timeline = { }, actions: { fetchTimeline ({ state, commit, rootState }, account) { - return new Promise((resolve, reject) => { - commit('TimelineSpace/Contents/SideBar/AccountProfile/changeLoading', true, { root: true }) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get(`/accounts/${account.id}/statuses`, { limit: 40 }, (err, data, res) => { - if (err) return reject(err) + commit('TimelineSpace/Contents/SideBar/AccountProfile/changeLoading', true, { root: true }) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get(`/accounts/${account.id}/statuses`, { limit: 40 }) + .then(data => { commit('TimelineSpace/Contents/SideBar/AccountProfile/changeLoading', false, { root: true }) commit('updateTimeline', data) - resolve(res) + return data }) - }) }, lazyFetchTimeline ({ state, commit, rootState }, info) { const last = info.last if (last === undefined || last === null) { - return null + return Promise.resolve(null) } - return new Promise((resolve, reject) => { - if (state.lazyLoading) { - return resolve() - } - commit('changeLazyLoading', true) - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get(`/accounts/${info.account.id}/statuses`, { max_id: last.id, limit: 40 }, (err, data, res) => { + if (state.lazyLoading) { + return Promise.resolve(null) + } + commit('changeLazyLoading', true) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get(`/accounts/${info.account.id}/statuses`, { max_id: last.id, limit: 40 }) + .then(data => { commit('changeLazyLoading', false) - if (err) return reject(err) commit('insertTimeline', data) + return data + }) + .catch(err => { + commit('changeLazyLoading', false) + throw err }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Contents/SideBar/TootDetail.js b/src/renderer/store/TimelineSpace/Contents/SideBar/TootDetail.js index 0beaa6157c..cd6403ef12 100644 --- a/src/renderer/store/TimelineSpace/Contents/SideBar/TootDetail.js +++ b/src/renderer/store/TimelineSpace/Contents/SideBar/TootDetail.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const TootDetail = { namespaced: true, @@ -92,19 +92,16 @@ const TootDetail = { commit('changeToot', message) }, fetchToot ({ state, commit, rootState }, message) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - }) - client.get(`/statuses/${message.id}/context`, { limit: 40 }, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get(`/statuses/${message.id}/context`, { limit: 40 }) + .then(data => { commit('updateAncestors', data.ancestors) commit('updateDescendants', data.descendants) - resolve(res) + return data }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/HeaderMenu.js b/src/renderer/store/TimelineSpace/HeaderMenu.js index d1131d464d..2602d31da8 100644 --- a/src/renderer/store/TimelineSpace/HeaderMenu.js +++ b/src/renderer/store/TimelineSpace/HeaderMenu.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const HeaderMenu = { namespaced: true, @@ -12,19 +12,15 @@ const HeaderMenu = { }, actions: { fetchList ({ state, commit, rootState }, listID) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.get(`/lists/${listID}`, {}, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.get(`/lists/${listID}`) + .then(data => { commit('updateTitle', `#${data.title}`) - resolve(res) + return data }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/Modals/NewToot.js b/src/renderer/store/TimelineSpace/Modals/NewToot.js index 2053ef7e63..f3cd7f15e8 100644 --- a/src/renderer/store/TimelineSpace/Modals/NewToot.js +++ b/src/renderer/store/TimelineSpace/Modals/NewToot.js @@ -1,6 +1,5 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' import { ipcRenderer } from 'electron' -import fs from 'fs' const NewToot = { namespaced: true, @@ -48,22 +47,18 @@ const NewToot = { }, actions: { postToot ({ state, commit, rootState }, form) { - return new Promise((resolve, reject) => { - if (rootState.TimelineSpace.account.accessToken === undefined || rootState.TimelineSpace.account.accessToken === null) { - return reject(new AuthenticationError()) - } - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.post('/statuses', form, (err, data, res) => { - if (err) return reject(err) + if (rootState.TimelineSpace.account.accessToken === undefined || rootState.TimelineSpace.account.accessToken === null) { + throw new AuthenticationError() + } + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + return client.post('/statuses', form) + .then(data => { ipcRenderer.send('toot-action-sound') - resolve(res) + return data }) - }) }, openReply ({ commit, rootState }, message) { commit('setReplyTo', message) @@ -85,25 +80,28 @@ const NewToot = { } }, uploadImage ({ state, commit, rootState }, image) { - return new Promise((resolve, reject) => { - commit('changeBlockSubmit', true) - if (rootState.TimelineSpace.account.accessToken === undefined || rootState.TimelineSpace.account.accessToken === null) { - return reject(new AuthenticationError()) - } - const client = new Mastodon( - { - access_token: rootState.TimelineSpace.account.accessToken, - api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' - } - ) - client.post('/media', { file: fs.createReadStream(image.path) }, (err, data, res) => { + commit('changeBlockSubmit', true) + if (rootState.TimelineSpace.account.accessToken === undefined || rootState.TimelineSpace.account.accessToken === null) { + throw new AuthenticationError() + } + const client = new Mastodon( + rootState.TimelineSpace.account.accessToken, + rootState.TimelineSpace.account.baseURL + '/api/v1' + ) + const formData = new FormData() + formData.append('file', image) + return client.post('/media', formData) + .then(data => { commit('changeBlockSubmit', false) - if (err) return reject(err) - if (data.type !== 'image') reject(new UnknownTypeError()) + if (data.type !== 'image') throw new UnknownTypeError() commit('appendAttachedMedias', data) - resolve(res) + return data + }) + .catch(err => { + commit('changeBlockSubmit', false) + console.error(err) + throw err }) - }) } } } diff --git a/src/renderer/store/TimelineSpace/SideMenu.js b/src/renderer/store/TimelineSpace/SideMenu.js index b60f8abcee..a5cfe0f72d 100644 --- a/src/renderer/store/TimelineSpace/SideMenu.js +++ b/src/renderer/store/TimelineSpace/SideMenu.js @@ -1,4 +1,4 @@ -import Mastodon from 'mastodon-api' +import Mastodon from 'megalodon' const SideMenu = { namespaced: true, @@ -28,19 +28,15 @@ const SideMenu = { }, actions: { fetchLists ({ commit }, account) { - return new Promise((resolve, reject) => { - const client = new Mastodon( - { - access_token: account.accessToken, - api_url: account.baseURL + '/api/v1' - } - ) - client.get('/lists', {}, (err, data, res) => { - if (err) return reject(err) + const client = new Mastodon( + account.accessToken, + account.baseURL + '/api/v1' + ) + return client.get('/lists') + .then(data => { commit('updateLists', data) - resolve(res) + return data }) - }) }, clearUnread ({ commit }) { commit('changeUnreadHomeTimeline', false)