Comparing version 7.3.1 to 7.4.0
@@ -5,2 +5,3 @@ #!/usr/bin/env node | ||
require('dotenv').config() | ||
process.env.DISABLE_STATS = 'true' | ||
@@ -25,8 +26,9 @@ const path = require('path') | ||
if (!program.event || !program.payloadPath || !githubToken) { | ||
if (!program.event || !program.payloadPath) { | ||
program.help() | ||
} | ||
if (githubToken) { | ||
process.env.DISABLE_STATS = 'true' | ||
const cert = findPrivateKey() | ||
if (!githubToken && (!program.app || !cert)) { | ||
console.warn('No token specified and no certifiate found, which means you will not be able to do authenticated requests to GitHub') | ||
} | ||
@@ -38,3 +40,3 @@ | ||
id: program.app, | ||
cert: findPrivateKey(), | ||
cert, | ||
githubToken: githubToken | ||
@@ -41,0 +43,0 @@ }) |
@@ -1,1 +0,2 @@ | ||
export {}; | ||
declare const _default: (app: any) => Promise<void>; | ||
export = _default; |
@@ -38,4 +38,2 @@ "use strict"; | ||
var _this = this; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// Built-in app to expose stats about the deployment | ||
module.exports = function (app) { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -68,3 +66,3 @@ function refresh() { | ||
github = _a.sent(); | ||
req = github.apps.getInstallations({ per_page: 100 }); | ||
req = github.apps.listInstallations({ per_page: 100 }); | ||
return [2 /*return*/, github.paginate(req, function (res) { return res.data; })]; | ||
@@ -95,3 +93,3 @@ } | ||
github = _a.sent(); | ||
req = github.apps.getInstallationRepositories({ per_page: 100 }); | ||
req = github.apps.listRepos({ per_page: 100 }); | ||
return [4 /*yield*/, github.paginate(req, function (res) { | ||
@@ -98,0 +96,0 @@ return res.data.repositories.filter(function (repository) { return !repository.private; }); |
@@ -109,3 +109,3 @@ import { WebhookEvent, WebhookPayloadWithRepository } from '@octokit/webhooks'; | ||
*/ | ||
config<T>(fileName: string, defaultConfig?: T): Promise<any>; | ||
config<T>(fileName: string, defaultConfig?: T): Promise<T | null>; | ||
} |
@@ -178,3 +178,3 @@ "use strict"; | ||
_a.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, this.github.repos.getContent(params)]; | ||
return [4 /*yield*/, this.github.repos.getContents(params)]; | ||
case 2: | ||
@@ -181,0 +181,0 @@ res = _a.sent(); |
@@ -1,2 +0,20 @@ | ||
import { GitHubAPI } from './'; | ||
import { GitHubAPI, Variables } from './'; | ||
export interface GraphQLError { | ||
message: string; | ||
locations?: Array<{ | ||
line: number; | ||
column: number; | ||
}>; | ||
path?: Array<string | number>; | ||
extensions?: { | ||
[key: string]: any; | ||
}; | ||
} | ||
export declare class GraphQLQueryError extends Error { | ||
errors: GraphQLError[]; | ||
query: string; | ||
variables: Variables; | ||
data: any; | ||
constructor(errors: GraphQLError[], query: string, variables: Variables, data: any); | ||
} | ||
export declare function addGraphQL(client: GitHubAPI): void; |
@@ -56,16 +56,19 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var GraphQLError = /** @class */ (function (_super) { | ||
__extends(GraphQLError, _super); | ||
function GraphQLError(errors, query, variables) { | ||
var _this = _super.call(this, JSON.stringify(errors)) || this; | ||
_this.name = 'GraphQLError'; | ||
var GraphQLQueryError = /** @class */ (function (_super) { | ||
__extends(GraphQLQueryError, _super); | ||
function GraphQLQueryError(errors, query, variables, data) { | ||
var _this = _super.call(this, "Error(s) occurred executing GraphQL query:\n" + JSON.stringify(errors, null, 2)) || this; | ||
_this.errors = errors; | ||
_this.query = query; | ||
_this.variables = variables; | ||
_this.data = data; | ||
_this.name = 'GraphQLQueryError'; | ||
if (Error.captureStackTrace) { | ||
Error.captureStackTrace(_this, GraphQLError); | ||
Error.captureStackTrace(_this, GraphQLQueryError); | ||
} | ||
return _this; | ||
} | ||
return GraphQLError; | ||
return GraphQLQueryError; | ||
}(Error)); | ||
exports.GraphQLQueryError = GraphQLQueryError; | ||
function addGraphQL(client) { | ||
@@ -91,4 +94,4 @@ client.query = graphql.bind(null, client); | ||
res = _a.sent(); | ||
if (res.data.errors) { | ||
throw new GraphQLError(res.data.errors, query, variables); | ||
if (res.data.errors && res.data.errors.length > 0) { | ||
throw new GraphQLQueryError(res.data.errors, query, variables, res.data.data); | ||
} | ||
@@ -95,0 +98,0 @@ return [2 /*return*/, res.data.data]; |
@@ -35,3 +35,3 @@ /// <reference types="bunyan" /> | ||
export interface GitHubAPI extends Octokit { | ||
paginate: (res: Promise<Octokit.AnyResponse>, callback: (results: Octokit.AnyResponse) => void) => Promise<any[]>; | ||
paginate: (res: Promise<Octokit.AnyResponse>, callback: (response: Promise<Octokit.AnyResponse>, done?: () => void) => void) => Promise<any[]>; | ||
hook: { | ||
@@ -43,3 +43,3 @@ error: (when: 'request', callback: (error: OctokitError, options: RequestOptions) => void) => void; | ||
request: (RequestOptions: RequestOptions) => Promise<Octokit.AnyResponse>; | ||
query: (query: string, variables?: Variables, headers?: Headers) => Promise<GraphQLResponse>; | ||
query: (query: string, variables?: Variables, headers?: Headers) => Promise<any>; | ||
} | ||
@@ -52,4 +52,2 @@ export interface Headers { | ||
} | ||
export interface GraphQLResponse { | ||
data: any; | ||
} | ||
export { GraphQLError, GraphQLQueryError } from './graphql'; |
@@ -28,2 +28,4 @@ "use strict"; | ||
exports.GitHubAPI = GitHubAPI; | ||
var graphql_2 = require("./graphql"); | ||
exports.GraphQLQueryError = graphql_2.GraphQLQueryError; | ||
//# sourceMappingURL=index.js.map |
@@ -111,3 +111,4 @@ "use strict"; | ||
// setup_url:`${baseUrl}/probot/success`, | ||
url: manifest.url || pkg.homepage || pkg.repository | ||
url: manifest.url || pkg.homepage || pkg.repository, | ||
version: 'v1' | ||
}, manifest)); | ||
@@ -114,0 +115,0 @@ return generatedManifest; |
{ | ||
"name": "probot", | ||
"version": "7.3.1", | ||
"version": "7.4.0", | ||
"description": "🤖 A framework for building GitHub Apps to automate and improve your workflow", | ||
@@ -67,3 +67,3 @@ "repository": "https://github.com/probot/probot", | ||
"dependencies": { | ||
"@octokit/rest": "^15.13.1", | ||
"@octokit/rest": "^15.18.0", | ||
"@octokit/webhooks": "^5.0.2", | ||
@@ -81,3 +81,3 @@ "@types/supports-color": "^5.3.0", | ||
"hbs": "^4.0.1", | ||
"is-base64": "0.0.5", | ||
"is-base64": "0.1.0", | ||
"js-yaml": "^3.9.1", | ||
@@ -84,0 +84,0 @@ "jsonwebtoken": "^8.1.0", |
@@ -1,7 +0,10 @@ | ||
# Probot | ||
<p align="center"> | ||
<a href="https://probot.github.io"><img src="/static/robot.svg" width="160" alt="Probot's logo, a cartoon robot" /></a> | ||
</p> | ||
<h3 align="center"><a href="https://probot.github.io">Probot</a></h3> | ||
<p align="center">A framework for building GitHub Apps to automate and improve your workflow<p> | ||
<p align="center"><a href="https://npmjs.com/package/probot"><img src="https://badgen.net/npm/v/probot" alt="NPM"></a> <a href="https://travis-ci.com/probot/probot"><img src="https://badgen.now.sh/travis/probot/probot" alt="Build Status"></a> <a href="https://codecov.io/gh/probot/probot/"><img src="https://badgen.now.sh/codecov/c/github/probot/probot" alt="Codecov"></a> <a href="https://twitter.com/ProbotTheRobot"><img src="https://img.shields.io/twitter/follow/ProbotTheRobot.svg?style=social&logo=twitter&label=Follow" alt="@ProbotTheRobot on Twitter"></a></p> | ||
[![npm version](https://img.shields.io/npm/v/probot.svg)](https://www.npmjs.com/package/probot) [![](https://img.shields.io/twitter/follow/ProbotTheRobot.svg?style=social&logo=twitter&label=Follow)](https://twitter.com/ProbotTheRobot) | ||
--- | ||
> 🤖 A framework for building GitHub Apps to automate and improve your workflow | ||
If you've ever thought, "wouldn't it be cool if GitHub could…"; I'm going to stop you right there. Most features can actually be added via [GitHub Apps](https://developer.github.com/apps/), which extend GitHub and can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. Apps are first class actors within GitHub. | ||
@@ -8,0 +11,0 @@ |
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
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
339281
2681
42
+ Addedis-base64@0.1.0(transitive)
- Removedis-base64@0.0.5(transitive)
Updated@octokit/rest@^15.18.0
Updatedis-base64@0.1.0