diff --git a/lib/github.js b/lib/github.js index 27ebf53..d8d7793 100644 --- a/lib/github.js +++ b/lib/github.js @@ -1,8 +1,11 @@ 'use strict' const inquirer = require('inquirer') -const Octokit = require('@octokit/rest') - .plugin(require('@octokit/plugin-throttling')) - .plugin(require('@octokit/plugin-retry')) +const { retry } = require('@octokit/plugin-retry') +const { throttling } = require('@octokit/plugin-throttling') +const { Octokit } = require('@octokit/rest') + +const OctokitRest = Octokit + .plugin(retry, throttling) const { graphql } = require('@octokit/graphql') @@ -75,7 +78,7 @@ async function getOctokit (opts = {}) { let { token, log, - onAbuseLimit, + onSecondaryRateLimit, onRateLimit } = opts @@ -94,10 +97,10 @@ async function getOctokit (opts = {}) { log = log || console - const octokit = Octokit({ + const octokit = new OctokitRest({ auth, throttle: { - onAbuseLimit: onAbuseLimit || ((err) => { + onSecondaryRateLimit: onSecondaryRateLimit || ((err) => { log.error(err) }), onRateLimit: onRateLimit || ((err, options) => { diff --git a/package.json b/package.json index 227955f..5941527 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,10 @@ "standard": "^12.0.1" }, "dependencies": { - "@octokit/graphql": "^4.3.1", - "@octokit/plugin-retry": "^2.2.0", - "@octokit/plugin-throttling": "^2.6.0", - "@octokit/rest": "^16.28.2", + "@octokit/graphql": "^7.1.0", + "@octokit/plugin-retry": "^6.0.1", + "@octokit/plugin-throttling": "^8.2.0", + "@octokit/rest": "^20.1.1", "@primer/octicons": "^9.1.1", "@wesleytodd/buildcss": "0.0.6", "@wesleytodd/buildjs": "0.0.8",