Comparing version 8.0.0-beta.7 to 8.0.0-beta.8
import OctokitApp from '@octokit/app'; | ||
import Octokit from '@octokit/rest'; | ||
import Webhooks from '@octokit/webhooks'; | ||
@@ -17,2 +18,3 @@ import express from 'express'; | ||
throttleOptions?: any; | ||
Octokit?: Octokit.Static; | ||
} | ||
@@ -32,2 +34,3 @@ /** | ||
private throttleOptions; | ||
private Octokit; | ||
constructor(options?: Options); | ||
@@ -34,0 +37,0 @@ /** |
@@ -75,2 +75,3 @@ "use strict"; | ||
this.throttleOptions = opts.throttleOptions; | ||
this.Octokit = opts.Octokit || github_1.ProbotOctokit; | ||
} | ||
@@ -233,2 +234,3 @@ /** | ||
options_1 = { | ||
Octokit: this.Octokit, | ||
auth: function () { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -256,2 +258,3 @@ var accessToken; | ||
github = github_1.GitHubAPI({ | ||
Octokit: this.Octokit, | ||
auth: "Bearer " + token, | ||
@@ -258,0 +261,0 @@ baseUrl: process.env.GHE_HOST && "https://" + process.env.GHE_HOST + "/api/v3", |
/// <reference types="bunyan" /> | ||
import Octokit from '@octokit/rest'; | ||
import { Logger } from './logging'; | ||
export declare const ProbotOctokit: Octokit.Static; | ||
/** | ||
@@ -15,2 +16,3 @@ * the [@octokit/rest Node.js module](https://github.com/octokit/rest.js), | ||
logger: Logger; | ||
Octokit: Octokit.Static; | ||
} | ||
@@ -17,0 +19,0 @@ export interface RequestOptions { |
@@ -13,3 +13,3 @@ "use strict"; | ||
var pagination_1 = require("./pagination"); | ||
var ProbotOctokit = rest_1.default | ||
exports.ProbotOctokit = rest_1.default | ||
.plugin(plugin_throttling_1.default) | ||
@@ -26,4 +26,4 @@ .plugin(plugin_retry_1.default) | ||
function GitHubAPI(options) { | ||
if (options === void 0) { options = {}; } | ||
var octokit = new ProbotOctokit(Object.assign(options, { | ||
if (options === void 0) { options = { Octokit: exports.ProbotOctokit }; } | ||
var octokit = new options.Octokit(Object.assign(options, { | ||
throttle: Object.assign({ | ||
@@ -30,0 +30,0 @@ onAbuseLimit: function (retryAfter) { return options.logger.warn("Abuse limit hit, retrying in " + retryAfter + " seconds"); }, |
@@ -0,1 +1,2 @@ | ||
import Octokit from '@octokit/rest'; | ||
import Webhooks from '@octokit/webhooks'; | ||
@@ -16,2 +17,3 @@ import Logger from 'bunyan'; | ||
private throttleOptions; | ||
private Octokit; | ||
constructor(options: Options); | ||
@@ -35,3 +37,4 @@ errorHandler(err: Error): void; | ||
redisConfig?: Redis.RedisOptions; | ||
Octokit?: Octokit.Static; | ||
} | ||
export { Logger, Context, Application }; | ||
export { Logger, Context, Application, Octokit }; |
@@ -42,2 +42,4 @@ "use strict"; | ||
var app_1 = __importDefault(require("@octokit/app")); | ||
var rest_1 = __importDefault(require("@octokit/rest")); | ||
exports.Octokit = rest_1.default; | ||
var webhooks_1 = __importDefault(require("@octokit/webhooks")); | ||
@@ -53,2 +55,3 @@ var bottleneck_1 = __importDefault(require("bottleneck")); | ||
exports.Context = context_1.Context; | ||
var github_1 = require("./github"); | ||
var logger_1 = require("./logger"); | ||
@@ -81,2 +84,3 @@ var resolver_1 = require("./resolver"); | ||
this.githubToken = options.githubToken; | ||
this.Octokit = options.Octokit || github_1.ProbotOctokit; | ||
if (this.options.id) { | ||
@@ -150,2 +154,3 @@ if (process.env.GHE_HOST && /^https?:\/\//.test(process.env.GHE_HOST)) { | ||
var app = new application_1.Application({ | ||
Octokit: this.Octokit, | ||
app: this.app, | ||
@@ -152,0 +157,0 @@ cache: cache, |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
/** | ||
@@ -3,0 +2,0 @@ * Finds a private key through various user-(un)specified methods. |
{ | ||
"name": "probot", | ||
"version": "8.0.0-beta.7", | ||
"version": "8.0.0-beta.8", | ||
"description": "🤖 A framework for building GitHub Apps to automate and improve your workflow", | ||
@@ -28,3 +28,3 @@ "repository": "https://github.com/probot/probot", | ||
"setupFiles": [ | ||
"<rootDir>/test/setup.js" | ||
"<rootDir>/test/setup.ts" | ||
], | ||
@@ -110,3 +110,3 @@ "coveragePathIgnorePatterns": [ | ||
"@types/nock": "^9.1.0", | ||
"@types/node": "^10.7.0", | ||
"@types/node": "^11.9.0", | ||
"@types/qs": "^6.5.1", | ||
@@ -113,0 +113,0 @@ "@types/raven": "^2.1.5", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
339749
2689