From 96ab4964445084effbb77b43f0b4e1bb40050461 Mon Sep 17 00:00:00 2001 From: Per Ploug Date: Thu, 15 Aug 2019 13:01:41 +0200 Subject: [PATCH 1/7] Added support for auth and risk UI Initial commit of new functionality for assess repository risk Signed-off-by: Per Ploug --- lib/auth/oauth.d.ts | 2 + lib/auth/oauth.js | 89 + lib/auth/oauth.js.map | 1 + lib/config/tasks.js | 6 + lib/config/tasks.js.map | 2 +- lib/index.js | 132 + lib/index.js.map | 2 +- lib/interfaces/config/irisksconfig.d.ts | 6 + lib/interfaces/config/irisksconfig.js | 3 + lib/interfaces/config/irisksconfig.js.map | 1 + lib/interfaces/config/itaskconfig.d.ts | 2 + lib/task-runner.js | 19 +- lib/task-runner.js.map | 2 +- lib/tasks/base.d.ts | 1 + lib/tasks/base.js | 20 + lib/tasks/base.js.map | 2 +- lib/tasks/risks.d.ts | 8 + lib/tasks/risks.js | 103 + lib/tasks/risks.js.map | 1 + package-lock.json | 2791 +++++++++++---------- package.json | 18 +- src/auth/oauth.ts | 52 + src/config/tasks.ts | 7 + src/index.ts | 114 +- src/interfaces/config/irisksconfig.ts | 6 + src/interfaces/config/itaskconfig.ts | 2 + src/task-runner.ts | 6 +- src/tasks/base.ts | 10 + src/tasks/risks.ts | 47 + test/zincr.test.ts | 4 +- views/risky.hbs | 223 ++ 31 files changed, 2322 insertions(+), 1360 deletions(-) create mode 100644 lib/auth/oauth.d.ts create mode 100644 lib/auth/oauth.js create mode 100644 lib/auth/oauth.js.map create mode 100644 lib/interfaces/config/irisksconfig.d.ts create mode 100644 lib/interfaces/config/irisksconfig.js create mode 100644 lib/interfaces/config/irisksconfig.js.map create mode 100644 lib/tasks/risks.d.ts create mode 100644 lib/tasks/risks.js create mode 100644 lib/tasks/risks.js.map create mode 100644 src/auth/oauth.ts create mode 100644 src/interfaces/config/irisksconfig.ts create mode 100644 src/tasks/risks.ts create mode 100644 views/risky.hbs diff --git a/lib/auth/oauth.d.ts b/lib/auth/oauth.d.ts new file mode 100644 index 0000000..971784a --- /dev/null +++ b/lib/auth/oauth.d.ts @@ -0,0 +1,2 @@ +import { Router } from "express"; +export declare function oauth(router: Router): void; diff --git a/lib/auth/oauth.js b/lib/auth/oauth.js new file mode 100644 index 0000000..2c20390 --- /dev/null +++ b/lib/auth/oauth.js @@ -0,0 +1,89 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var request = require('request'); +var querystring = require('querystring'); +var promisify = require('util').promisify; +var post = promisify(request.post); +function oauth(router) { + var _this = this; + var gh_host = process.env.GHE_HOST || "github.com"; + router.get('/github/login', function (req, res) { + var protocol = req.headers["x-forwarded-proto"] || req.protocol; + var host = req.headers['x-forwarded-host'] || req.get('host'); + var params = querystring.stringify({ + client_id: process.env.CLIENT_ID, + redirect_uri: protocol + "://" + host + "/github/callback" + }); + var url = "https://" + gh_host + "/login/oauth/authorize?" + params; + //req.log({url}, 'Redirecting to OAuth') + res.redirect(url); + }); + router.get('/github/callback', function (req, res) { return __awaiter(_this, void 0, void 0, function () { + var tokenRes; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, post({ + url: "https://" + gh_host + "/login/oauth/access_token", + form: { + client_id: process.env.CLIENT_ID, + client_secret: process.env.CLIENT_SECRET, + code: req.query.code, + state: req.query.state + }, + json: true + })]; + case 1: + tokenRes = _a.sent(); + if (tokenRes.statusCode === 200) { + if (!req.session) { + req.session = {}; + } + req.session.token = tokenRes.body.access_token; + res.redirect(req.session.redirect || '/'); + } + else { + res.status(500); + res.send('Invalid code'); + } + return [2 /*return*/]; + } + }); + }); }); +} +exports.oauth = oauth; +//# sourceMappingURL=oauth.js.map \ No newline at end of file diff --git a/lib/auth/oauth.js.map b/lib/auth/oauth.js.map new file mode 100644 index 0000000..cba23e5 --- /dev/null +++ b/lib/auth/oauth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../src/auth/oauth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CA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,EAAE,IAAI;qBACX,CAAC,EAAA;;oBATI,QAAQ,GAAG,SASf;oBAEF,IAAI,QAAQ,CAAC,UAAU,KAAK,GAAG,EAAE;wBAC/B,IAAG,CAAC,GAAG,CAAC,OAAO,EAAC;4BACd,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC;yBAClB;wBAED,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAA;wBAC9C,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAA;qBAC1C;yBAAM;wBACL,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;wBACf,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;qBACzB;;;;SACF,CAAC,CAAA;AACJ,CAAC;AA3CD,sBA2CC"} \ No newline at end of file diff --git a/lib/config/tasks.js b/lib/config/tasks.js index f731220..0698a37 100644 --- a/lib/config/tasks.js +++ b/lib/config/tasks.js @@ -11,6 +11,12 @@ var TaskConfig = { minimum: 2, enabled: true }, + risks: { + enabled: true, + tag: "risk", + tracker: "github", + url: "" + }, specification: { enabled: true, title: { diff --git a/lib/config/tasks.js.map b/lib/config/tasks.js.map index d731c6b..c705484 100644 --- a/lib/config/tasks.js.map +++ b/lib/config/tasks.js.map @@ -1 +1 @@ -{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/config/tasks.ts"],"names":[],"mappings":";;AAGA,IAAI,UAAU,GAAiB;IAC3B,OAAO,EAAE,IAAI;IAEb,YAAY,EAAG;QACb,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,GAAG;KACd;IAED,SAAS,EAAE;QACT,aAAa,EAAE,IAAI;QACnB,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,IAAI;KACd;IAED,aAAa,EAAE;QACb,OAAO,EAAE,IAAI;QAEb,KAAK,EAAE;YACL,gBAAgB,EAAE;gBAChB,MAAM,EAAE,CAAC;gBACT,OAAO,EAAE,IAAI;aACd;SACF;QAED,IAAI,EAAE;YACJ,gBAAgB,EAAE;gBAChB,MAAM,EAAE,CAAC;gBACT,OAAO,EAAE,IAAI;aACd;YAED,cAAc,EAAE,KAAK;YACrB,uBAAuB,EAAE,IAAI;SAC9B;QAED,QAAQ,EAAE;YACR,mBAAmB,EAAE,IAAI;SAC1B;KACF;IAED,OAAO,EAAG;QACR,kFAAkF;QAClF,6BAA6B;QAC7B,SAAS,EAAE;YACT,SAAS,EAAO,SAAS,EAAO,UAAU,EAAM,YAAY,EAAI,YAAY;YAC5E,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS;YACzE,WAAW,EAAK,WAAW,EAAK,WAAW,EAAK,WAAW,EAAK,WAAW;YAC3E,SAAS,EAAO,UAAU,EAAM,UAAU,EAAM,SAAS,EAAO,SAAS;YACzE,KAAK,EAAW,SAAS,EAAO,KAAK,EAAW,UAAU,EAAM,UAAU;YAC1E,UAAU,EAAM,UAAU,EAAM,KAAK,EAAW,SAAS,EAAO,SAAS;YACzE,SAAS,EAAO,OAAO,EAAS,MAAM,EAAU,SAAS,EAAO,SAAS;YACzE,MAAM,EAAU,WAAW,EAAK,KAAK,EAAW,MAAM,EAAU,SAAS;YACzE,UAAU,EAAM,MAAM,EAAU,SAAS;SAC1C;QAED,sBAAsB;QACtB,OAAO,EAAE,EAAE;QAEX,WAAW,yBAAoB;QAC/B,UAAU,yBAAoB;QAE9B,OAAO,EAAE,IAAI;KACd;CACJ,CAAC;AAEO,gCAAU"} \ No newline at end of file +{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/config/tasks.ts"],"names":[],"mappings":";;AAGA,IAAI,UAAU,GAAiB;IAC3B,OAAO,EAAE,IAAI;IAEb,YAAY,EAAG;QACb,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,GAAG;KACd;IAED,SAAS,EAAE;QACT,aAAa,EAAE,IAAI;QACnB,OAAO,EAAE,CAAC;QACV,OAA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index.js index 1600831..7f89dca 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,15 @@ "use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -34,8 +45,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) { if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; +var _this = this; var app_1 = require("./config/app"); var zincr_1 = require("./zincr"); +var cookieSession = require("cookie-session"); +var oauth_1 = require("./auth/oauth"); +var github_1 = require("probot/lib/github"); console.log(process.env); module.exports = function (app) { var setStatusPass = require("./set-status-pass"); @@ -70,5 +85,122 @@ module.exports = function (app) { }); }); } + // Functionality for risky UI and auth against GHE + var server = app.route(); + //const client_id = process.env.CLIENT_ID; + //const client_secret = process.env.CLIENT_SECRET; + var ghe_host = process.env.GHE_HOST; + function authenticate(req, res, next) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (!req.session || !req.session.token) { + req.session = {}; + req.session.redirect = req.originalUrl; + res.redirect('/github/login'); + } + else { + next(); + } + return [2 /*return*/]; + }); + }); + } + if (process.env.WEBHOOK_SECRET) { + server.use(cookieSession({ + name: 'session', + keys: [process.env.WEBHOOK_SECRET], + maxAge: 30 * 24 * 60 * 60 * 1000 // 30 days + })); + } + oauth_1.oauth(server); + server.use(function (req, res, next) { return __awaiter(_this, void 0, void 0, function () { + var gh, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!req.session) return [3 /*break*/, 3]; + if (!req.session.token) return [3 /*break*/, 3]; + return [4 /*yield*/, app.auth()]; + case 1: + gh = _b.sent(); + gh.authenticate({ type: 'token', token: req.session.token }); + if (!!req.session.login) return [3 /*break*/, 3]; + _a = req.session; + return [4 /*yield*/, gh.users.getAuthenticated({})]; + case 2: + _a.login = (_b.sent()).data.login; + _b.label = 3; + case 3: + next(); + return [2 /*return*/]; + } + }); + }); }); + server.get('/risky/:owner/:repo', authenticate, function (req, res) { return __awaiter(_this, void 0, void 0, function () { + var octokit, gh_repo, repo, riskFile, err_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(req.session && ghe_host)) return [3 /*break*/, 6]; + _a.label = 1; + case 1: + _a.trys.push([1, 4, , 5]); + octokit = github_1.GitHubAPI({ + baseUrl: "https://" + ghe_host + "/api/v3", + logger: { + debug: function () { }, + info: function () { }, + warn: console.warn, + error: console.error + }, + }); + octokit.authenticate({ type: 'token', token: req.session.token }); + gh_repo = { owner: req.params.owner, repo: req.params.repo }; + return [4 /*yield*/, octokit.repos.get(gh_repo)]; + case 2: + repo = _a.sent(); + return [4 /*yield*/, octokit.repos.getContents(__assign({ path: "risks.md" }, gh_repo))]; + case 3: + riskFile = _a.sent(); + //todo, parse and process the risk file + res.render("../../../views/risky", { repo: repo.data, risks: riskFile.data }); + return [3 /*break*/, 5]; + case 4: + err_1 = _a.sent(); + // It threw an error so they can't see the repo + res.send(err_1); + return [3 /*break*/, 5]; + case 5: return [3 /*break*/, 7]; + case 6: + res.send("no session"); + _a.label = 7; + case 7: return [2 /*return*/]; + } + }); + }); }); + /* + server.get('/login', async (req, res) => { + const querystring = require('querystring'); + + //get needed values + const client_id = process.env.CLIENT_ID; + const ghe_host = process.env.GHE_HOST; + + if(!client_id || !ghe_host) + return; + + // GitHub needs us to tell it where to redirect users after they've authenticated + const protocol = req.headers['x-forwarded-proto'] || req.protocol + const host = req.headers['x-forwarded-host'] || req.get('host') + + const params = querystring.stringify({ + client_id: client_id, + redirect_uri: `${protocol}://${host}/login/cb` + }) + + const url = `https://${ghe_host}/login/oauth/authorize?${params}` + res.redirect(url) + }); + */ }; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map index aeb12ca..761ecec 100644 --- a/lib/index.js.map +++ b/lib/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,oCAAwD;AACxD,iCAAgC;AAGhC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAEzB,iBAAS,UAAC,GAAgB;IAExB,IAAM,aAAa,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACnD,IAAM,MAAM,GAAG,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC;IAEvD,uDAAuD;IACvD,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACnC,GAAG,CAAC,EAAE,CAAC,4BAA4B,EAAE,aAAa,CAAC,CAAA;IAEnD,SAAe,kBAAkB,CAAC,OAAiB;;;;;;;4BAG/C,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE;4BACpB,YAAY,EAAE,IAAI;;wBACN,qBAAM,oBAAc,CAAC,OAAO,CAAC,EAAA;;wBAHrC,MAAM,IAGV,aAAU,GAAE,SAA6B;4BACzC,YAAS,GAAE,eAAS;+BACrB;wBAED,IAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,EAAC;4BAC1F,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC;yBACrE;wBAEG,KAAK,GAAG,IAAI,aAAK,CAAC,MAAM,CAAC,CAAC;wBAC9B,qBAAM,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAA;;wBAA7B,SAA6B,CAAC;;;;;KAC/B;AACH,CAAC,CAAC"} \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,+CAA+C;oBAC/C,GAAG,CAAC,IAAI,CAAC,KAAG,CAAC,CAAC;;;;oBAMhB,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;;;;;SAE1B,CAAC,CAAC;IAGH;;;;;;;;;;;;;;;;;;;;;;;MAuBE;AAIJ,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/interfaces/config/irisksconfig.d.ts b/lib/interfaces/config/irisksconfig.d.ts new file mode 100644 index 0000000..e183ee4 --- /dev/null +++ b/lib/interfaces/config/irisksconfig.d.ts @@ -0,0 +1,6 @@ +export interface IRisksConfig { + enabled: boolean; + tag: string; + tracker: string; + url: string; +} diff --git a/lib/interfaces/config/irisksconfig.js b/lib/interfaces/config/irisksconfig.js new file mode 100644 index 0000000..ef09e9c --- /dev/null +++ b/lib/interfaces/config/irisksconfig.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=irisksconfig.js.map \ No newline at end of file diff --git a/lib/interfaces/config/irisksconfig.js.map b/lib/interfaces/config/irisksconfig.js.map new file mode 100644 index 0000000..37c4b61 --- /dev/null +++ b/lib/interfaces/config/irisksconfig.js.map @@ -0,0 +1 @@ +{"version":3,"file":"irisksconfig.js","sourceRoot":"","sources":["../../../src/interfaces/config/irisksconfig.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/config/itaskconfig.d.ts b/lib/interfaces/config/itaskconfig.d.ts index 7c98df1..1bac341 100644 --- a/lib/interfaces/config/itaskconfig.d.ts +++ b/lib/interfaces/config/itaskconfig.d.ts @@ -2,11 +2,13 @@ import { ILicenseConfig } from "./ilicenseconfig"; import { IApprovalsConfig } from "./iapprovalsconfig"; import { ISpecificationConfig } from "./ispecificationconfig"; import { ILargeCommitsConfig } from "./ilargecommitsconfig"; +import { IRisksConfig } from "./irisksconfig"; export interface ITaskConfig { comment?: boolean; license?: ILicenseConfig; approvals?: IApprovalsConfig; specification?: ISpecificationConfig; largecommits?: ILargeCommitsConfig; + risks?: IRisksConfig; [key: string]: any; } diff --git a/lib/task-runner.js b/lib/task-runner.js index 2a15fc7..f0a4136 100644 --- a/lib/task-runner.js +++ b/lib/task-runner.js @@ -94,7 +94,7 @@ var TaskRunner = /** @class */ (function () { }; TaskRunner.prototype.run = function (context) { return __awaiter(this, void 0, void 0, function () { - var results, runners, _i, runners_1, runner, ex_2, result; + var results, runners, _i, runners_1, runner, result; return __generator(this, function (_a) { switch (_a.label) { case 0: @@ -105,24 +105,17 @@ var TaskRunner = /** @class */ (function () { _i = 0, runners_1 = runners; _a.label = 2; case 2: - if (!(_i < runners_1.length)) return [3 /*break*/, 7]; + if (!(_i < runners_1.length)) return [3 /*break*/, 5]; runner = runners_1[_i]; - _a.label = 3; + return [4 /*yield*/, runner.start(context)]; case 3: - _a.trys.push([3, 5, , 6]); - return [4 /*yield*/, runner.run(context)]; - case 4: _a.sent(); results.push(runner); - return [3 /*break*/, 6]; - case 5: - ex_2 = _a.sent(); - console.log(ex_2); - return [3 /*break*/, 6]; - case 6: + _a.label = 4; + case 4: _i++; return [3 /*break*/, 2]; - case 7: + case 5: result = { Failure: results.filter(function (x) { return x.summary().Failure.length > 0; }), Warning: results.filter(function (x) { return x.summary().Warning.length > 0 && x.summary().Failure.length == 0; }), diff --git a/lib/task-runner.js.map b/lib/task-runner.js.map index 0770efa..a1e9616 100644 --- a/lib/task-runner.js.map +++ b/lib/task-runner.js.map @@ -1 +1 @@ -{"version":3,"file":"task-runner.js","sourceRoot":"","sources":["../src/task-runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;IAQE,oBAAY,MAA0B;QACpC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,G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B,MAAM;wBACZ,qBAAM,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAA;;wBAA3B,SAA2B,CAAC;wBAC5B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;;wBAFL,IAAO,CAAA;;;wBAKrB,MAAM,GAAyB;4BACnC,OAAO,EAAG,OAAO,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAA9B,CAA8B,CAAC;4BAC7D,OAAO,EAAG,OAAO,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAjE,CAAiE,CAAC;4BAChG,OAAO,EAAG,OAAO,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAlE,CAAkE,CAAC;yBAClG,CAAA;wBAED,sBAAO,MAAM,EAAC;;;;KAEf;IACH,iBAAC;AAAD,CAAC,AAjED,IAiEC;AAjEY,gCAAU"} \ No newline at end of file diff --git a/lib/tasks/base.d.ts b/lib/tasks/base.d.ts index e1f2e8f..ec123f9 100644 --- a/lib/tasks/base.d.ts +++ b/lib/tasks/base.d.ts @@ -19,6 +19,7 @@ export declare abstract class BaseTask implements ITask { organization: string | null; private _summary; constructor(params: ITaskParams); + start(context: Context): Promise; run(context: Context): Promise; summary(): IResultSummary; success(): boolean; diff --git a/lib/tasks/base.js b/lib/tasks/base.js index 5b1b1d0..0b89614 100644 --- a/lib/tasks/base.js +++ b/lib/tasks/base.js @@ -49,6 +49,26 @@ var BaseTask = /** @class */ (function () { this.result = new Array(); this.organization = params.organization; } + BaseTask.prototype.start = function (context) { + return __awaiter(this, void 0, void 0, function () { + var ex_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, this.run(context)]; + case 1: + _a.sent(); + return [3 /*break*/, 3]; + case 2: + ex_1 = _a.sent(); + this.result.push({ result: "warning" /* Warning */, description: ex_1, label: "Task failed" }); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); + }; BaseTask.prototype.run = function (context) { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { diff --git a/lib/tasks/base.js.map b/lib/tasks/base.js.map index 3f5aaa9..9fea4c7 100644 --- a/lib/tasks/base.js.map +++ b/lib/tasks/base.js.map @@ -1 +1 @@ -{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/tasks/base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;IAeE,kBAAa,MAAuB;QAdpC,SAAI,GAAG,EAAE,CAAC;QACV,gBAAW,GAAG,EAAE,CAAC;QACjB,eAAU,GAAG,EAAE,CAAC;QAEhB,WAAM,GAAG,IAAI,KAAK,EAAW,CAAC;QAC9B,kBAAa,GAAG,KAAK,CAAC;QAOd,aAAQ,GAA2B,IAAI,CAAC;QAG9C,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,KAAK,EAAW,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IAC1C,CAAC;IAEK,sBAAG,GAAT,UAAU,OAAgB;;;gBACxB,sBAAO,IAAI,EAAC;;;KACb;IAED,0BAAO,GAAP;QAEE,IAAG,IAAI,CAAC,QAAQ,IAAI,IA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C,MAAM,EAAX,cAAW,EAAX,IAAW,EAAC;gBAA/B,IAAM,SAAS,SAAA;gBAEf,WAAW,CAAC,IAAI,CAAC,QAAK,CAAC,OAAO,CAAC,WAAW,IAAI,SAAS,CAAC,MAAM,4BAAuB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,UAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAI,SAAS,CAAC,KAAO,CAAC,CAAC;gBAEpJ,IAAG,OAAO,CAAC,kBAAkB,IAAI,SAAS,CAAC,WAAW,EAAC;oBACrD,WAAW,CAAC,IAAI,CAAC,SAAO,SAAS,CAAC,WAAa,CAAC,CAAC;iBAClD;aACJ;SACF;QAED,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3B,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IACH,eAAC;AAAD,CAAC,AAtGD,IAsGC;AAtGqB,4BAAQ"} \ No newline at end of file diff --git a/lib/tasks/risks.d.ts b/lib/tasks/risks.d.ts new file mode 100644 index 0000000..140f473 --- /dev/null +++ b/lib/tasks/risks.d.ts @@ -0,0 +1,8 @@ +import { Context } from "probot"; +import { BaseTask } from "./base"; +import { ITaskParams } from "../interfaces/params/itaskparams"; +import { IRisksConfig } from "../interfaces/config/irisksconfig"; +export default class RisksTask extends BaseTask { + constructor(params: ITaskParams); + run(context: Context): Promise; +} diff --git a/lib/tasks/risks.js b/lib/tasks/risks.js new file mode 100644 index 0000000..4e33c0d --- /dev/null +++ b/lib/tasks/risks.js @@ -0,0 +1,103 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var base_1 = require("./base"); +var RisksTask = /** @class */ (function (_super) { + __extends(RisksTask, _super); + function RisksTask(params) { + var _this = _super.call(this, params) || this; + _this.name = "Risk Assessment"; + _this.description = "Guides developers to assess the risk of their application by checking the change data and validity of risks.md"; + _this.resolution = "Please ensure you have a risks.md file and it is updated regularly"; + _this.postAsComment = true; + return _this; + } + RisksTask.prototype.run = function (context) { + return __awaiter(this, void 0, void 0, function () { + var riskfile; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, context.github.repos.getContents(__assign({}, this.repo, { path: "risks.md" }))]; + case 1: + riskfile = _a.sent(); + if (riskfile.status !== 200) { + this.result.push({ + label: "No risks.md file found", + result: "failure" /* Failure */, + description: "Create a risks.md file - [Click here](https://" + context.host + "/risky/" + this.repo.owner + "/" + this.repo.repo + "/)" + }); + } + else { + this.result.push({ + label: "Update your Risks.md file", + result: "failure" /* Failure */, + description: "Update your risk assessment - [Click here](https://" + context.host + "/risky/" + this.repo.owner + "/" + this.repo.repo + "/)" + }); + } + return [2 /*return*/, true]; + } + }); + }); + }; + return RisksTask; +}(base_1.BaseTask)); +exports.default = RisksTask; +//# sourceMappingURL=risks.js.map \ No newline at end of file diff --git a/lib/tasks/risks.js.map b/lib/tasks/risks.js.map new file mode 100644 index 0000000..31b8523 --- /dev/null +++ b/lib/tasks/risks.js.map @@ -0,0 +1 @@ +{"version":3,"file":"risks.js","sourceRoot":"","sources":["../../src/tasks/risks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAkC;AAKlC;IAAuC,6BAAsB;IAE3D,mBAAY,MAAkC;QAA9C,YACE,kBAAM,MAAM,CAAC,SAMd;QAJC,KAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,KAAI,CAAC,WAAW,GAAI,gHAAgH,CAAC;QACrI,KAAI,CAAC,UAAU,GAAG,oEAAoE,CAAC;QACvF,KAAI,CAAC,aAAa,GAAG,IAAI,CAAC;;IAC5B,CAAC;IAGK,uBAAG,GAAT,UAAU,OAAgB;;;;;4BAEP,qBAAM,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,cAAO,IAAI,CAAC,IAAI,IAAE,IAAI,EAAE,UAAU,IAAI,EAAA;;wBAAvF,QAAQ,GAAG,SAA4E;wBAC7F,IAAG,QAAQ,CAAC,MAAM,KAAK,GAAG,EAC1B;4BAEE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gCACf,KAAK,EAAE,wBAAwB;gCAC/B,MAAM,yBAAoB;gCAC1B,WAAW,EAAE,mDAAiD,OAAO,CAAC,IAAI,eAAU,IAAI,CAAC,IAAI,CAAC,KAAK,SAAI,IAAI,CAAC,IAAI,CAAC,IAAI,OAAI;6BAC1H,CAAC,CAAA;yBAEH;6BAAI;4BAEH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gCACf,KAAK,EAAE,2BAA2B;gCAClC,MAAM,yBAAoB;gCAC1B,WAAW,EAAE,wDAAsD,OAAO,CAAC,IAAI,eAAU,IAAI,CAAC,IAAI,CAAC,KAAK,SAAI,IAAI,CAAC,IAAI,CAAC,IAAI,OAAI;6BAC/H,CAAC,CAAA;yBAEH;wBAED,sBAAO,IAAI,EAAC;;;;KACb;IACH,gBAAC;AAAD,CAAC,AApCD,CAAuC,eAAQ,GAoC9C"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1a89474..29f0768 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,27 +14,103 @@ } }, "@babel/core": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.3.tgz", - "integrity": "sha512-oDpASqKFlbspQfzAE7yaeTmdljSH2ADIvBlb0RwbStltTuWa0+7CCI1fYVINNv9saHPa1W7oaKeuNuKj+RQCvA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.0", - "@babel/helpers": "^7.4.3", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.5.5.tgz", + "integrity": "sha512-i4qoSr2KTtce0DmkuuQBV4AuQgGPUcPXMr9L5MyYAtk06z068lQ10a4O009fe5OB/DfNV+h+qqT7ddNV8UnRjg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.5.5", + "@babel/helpers": "^7.5.5", + "@babel/parser": "^7.5.5", + "@babel/template": "^7.4.4", + "@babel/traverse": "^7.5.5", + "@babel/types": "^7.5.5", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", - "lodash": "^4.17.11", + "lodash": "^4.17.13", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" }, "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/generator": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz", + "integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==", + "dev": true, + "requires": { + "@babel/types": "^7.5.5", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/parser": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", + "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", + "dev": true + }, + "@babel/template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", + "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4" + } + }, + "@babel/traverse": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz", + "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.5.5", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.5.5", + "@babel/types": "^7.5.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", + "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -44,12 +120,6 @@ "ms": "^2.1.1" } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -115,14 +185,109 @@ } }, "@babel/helpers": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.4.3.tgz", - "integrity": "sha512-BMh7X0oZqb36CfyhvtbSmcWc3GXocfxv3yNsAEuM0l+fAqSO22rQrUpijr3oE/10jCTrB6/0b9kzmG4VetCj8Q==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.5.5.tgz", + "integrity": "sha512-nRq2BUhxZFnfEn/ciJuhklHvFOqjJUD5wpx+1bxUF2axL9C+v4DE/dmp5sT2dKnpOs4orZWzpAZqlCy8QqE/7g==", "dev": true, "requires": { - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0" + "@babel/template": "^7.4.4", + "@babel/traverse": "^7.5.5", + "@babel/types": "^7.5.5" + }, + "dependencies": { + "@babel/generator": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz", + "integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==", + "dev": true, + "requires": { + "@babel/types": "^7.5.5", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/parser": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", + "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", + "dev": true + }, + "@babel/template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", + "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4" + } + }, + "@babel/traverse": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz", + "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.5.5", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.5.5", + "@babel/types": "^7.5.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + } + } + }, + "@babel/types": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", + "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } } }, "@babel/highlight": { @@ -299,32 +464,32 @@ } }, "@jest/core": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.7.1.tgz", - "integrity": "sha512-ivlZ8HX/FOASfHcb5DJpSPFps8ydfUYzLZfgFFqjkLijYysnIEOieg72YRhO4ZUB32xu40hsSMmaw+IGYeKONA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.8.0.tgz", + "integrity": "sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A==", "dev": true, "requires": { "@jest/console": "^24.7.1", - "@jest/reporters": "^24.7.1", - "@jest/test-result": "^24.7.1", - "@jest/transform": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/reporters": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", "ansi-escapes": "^3.0.0", "chalk": "^2.0.1", "exit": "^0.1.2", "graceful-fs": "^4.1.15", - "jest-changed-files": "^24.7.0", - "jest-config": "^24.7.1", - "jest-haste-map": "^24.7.1", - "jest-message-util": "^24.7.1", + "jest-changed-files": "^24.8.0", + "jest-config": "^24.8.0", + "jest-haste-map": "^24.8.0", + "jest-message-util": "^24.8.0", "jest-regex-util": "^24.3.0", - "jest-resolve-dependencies": "^24.7.1", - "jest-runner": "^24.7.1", - "jest-runtime": "^24.7.1", - "jest-snapshot": "^24.7.1", - "jest-util": "^24.7.1", - "jest-validate": "^24.7.0", - "jest-watcher": "^24.7.1", + "jest-resolve-dependencies": "^24.8.0", + "jest-runner": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-snapshot": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", + "jest-watcher": "^24.8.0", "micromatch": "^3.1.10", "p-each-series": "^1.0.0", "pirates": "^4.0.1", @@ -359,29 +524,6 @@ "supports-color": "^5.3.0" } }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -403,49 +545,50 @@ } }, "@jest/environment": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.7.1.tgz", - "integrity": "sha512-wmcTTYc4/KqA+U5h1zQd5FXXynfa7VGP2NfF+c6QeGJ7c+2nStgh65RQWNX62SC716dTtqheTRrZl0j+54oGHw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.8.0.tgz", + "integrity": "sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw==", "dev": true, "requires": { - "@jest/fake-timers": "^24.7.1", - "@jest/transform": "^24.7.1", - "@jest/types": "^24.7.0", - "jest-mock": "^24.7.0" + "@jest/fake-timers": "^24.8.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", + "jest-mock": "^24.8.0" } }, "@jest/fake-timers": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.7.1.tgz", - "integrity": "sha512-4vSQJDKfR2jScOe12L9282uiwuwQv9Lk7mgrCSZHA9evB9efB/qx8i0KJxsAKtp8fgJYBJdYY7ZU6u3F4/pyjA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.8.0.tgz", + "integrity": "sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw==", "dev": true, "requires": { - "@jest/types": "^24.7.0", - "jest-message-util": "^24.7.1", - "jest-mock": "^24.7.0" + "@jest/types": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-mock": "^24.8.0" } }, "@jest/reporters": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.7.1.tgz", - "integrity": "sha512-bO+WYNwHLNhrjB9EbPL4kX/mCCG4ZhhfWmO3m4FSpbgr7N83MFejayz30kKjgqr7smLyeaRFCBQMbXpUgnhAJw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.8.0.tgz", + "integrity": "sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw==", "dev": true, "requires": { - "@jest/environment": "^24.7.1", - "@jest/test-result": "^24.7.1", - "@jest/transform": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/environment": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", "exit": "^0.1.2", "glob": "^7.1.2", - "istanbul-api": "^2.1.1", "istanbul-lib-coverage": "^2.0.2", "istanbul-lib-instrument": "^3.0.1", + "istanbul-lib-report": "^2.0.4", "istanbul-lib-source-maps": "^3.0.1", - "jest-haste-map": "^24.7.1", - "jest-resolve": "^24.7.1", - "jest-runtime": "^24.7.1", - "jest-util": "^24.7.1", + "istanbul-reports": "^2.1.1", + "jest-haste-map": "^24.8.0", + "jest-resolve": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-util": "^24.8.0", "jest-worker": "^24.6.0", "node-notifier": "^5.2.1", "slash": "^2.0.0", @@ -473,20 +616,6 @@ "supports-color": "^5.3.0" } }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -510,44 +639,44 @@ } }, "@jest/test-result": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.7.1.tgz", - "integrity": "sha512-3U7wITxstdEc2HMfBX7Yx3JZgiNBubwDqQMh+BXmZXHa3G13YWF3p6cK+5g0hGkN3iufg/vGPl3hLxQXD74Npg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.8.0.tgz", + "integrity": "sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng==", "dev": true, "requires": { "@jest/console": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "@types/istanbul-lib-coverage": "^2.0.0" } }, "@jest/test-sequencer": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.7.1.tgz", - "integrity": "sha512-84HQkCpVZI/G1zq53gHJvSmhUer4aMYp9tTaffW28Ih5OxfCg8hGr3nTSbL1OhVDRrFZwvF+/R9gY6JRkDUpUA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz", + "integrity": "sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg==", "dev": true, "requires": { - "@jest/test-result": "^24.7.1", - "jest-haste-map": "^24.7.1", - "jest-runner": "^24.7.1", - "jest-runtime": "^24.7.1" + "@jest/test-result": "^24.8.0", + "jest-haste-map": "^24.8.0", + "jest-runner": "^24.8.0", + "jest-runtime": "^24.8.0" } }, "@jest/transform": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.7.1.tgz", - "integrity": "sha512-EsOUqP9ULuJ66IkZQhI5LufCHlTbi7hrcllRMUEV/tOgqBVQi93+9qEvkX0n8mYpVXQ8VjwmICeRgg58mrtIEw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.8.0.tgz", + "integrity": "sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "babel-plugin-istanbul": "^5.1.0", "chalk": "^2.0.1", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.0.0", "graceful-fs": "^4.1.15", - "jest-haste-map": "^24.7.1", + "jest-haste-map": "^24.8.0", "jest-regex-util": "^24.3.0", - "jest-util": "^24.7.1", + "jest-util": "^24.8.0", "micromatch": "^3.1.10", "realpath-native": "^1.1.0", "slash": "^2.0.0", @@ -587,12 +716,13 @@ } }, "@jest/types": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.7.0.tgz", - "integrity": "sha512-ipJUa2rFWiKoBqMKP63Myb6h9+iT3FHRTF2M8OR6irxWzItisa8i4dcSg14IbvmXUnBlHBlUQPYUHWyX3UPpYA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", + "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", "@types/yargs": "^12.0.9" } }, @@ -619,20 +749,14 @@ "requires": { "ms": "^2.1.1" } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" } } }, "@octokit/webhooks": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@octokit/webhooks/-/webhooks-5.4.1.tgz", - "integrity": "sha512-vslTwKYAQY6lFgKIpwEvID+TfKFuKHpLFJ10mdTLjQnG22ywo/T9Kfz0SvIWshtAA0thvndhXeZU0v6cFpAlEQ==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/@octokit/webhooks/-/webhooks-6.2.2.tgz", + "integrity": "sha512-6bytSyiPq2gq+61OWbN31EadC4onh+oip+i1t96glQZ+XweVBSherJTLuyztJ9zqeQHSdYc7O48bc2JObpjR3A==", "requires": { - "buffer-equal-constant-time": "^1.0.1", "debug": "^4.0.0" }, "dependencies": { @@ -643,18 +767,13 @@ "requires": { "ms": "^2.1.1" } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" } } }, "@types/babel__core": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.0.tgz", - "integrity": "sha512-wJTeJRt7BToFx3USrCDs2BhEi4ijBInTQjOIukj6a/5tEkwpFMVZ+1ppgmE+Q/FQyc5P/VWUbx7I9NELrKruHA==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.2.tgz", + "integrity": "sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -684,47 +803,112 @@ } }, "@types/babel__traverse": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.6.tgz", - "integrity": "sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw==", + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.7.tgz", + "integrity": "sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw==", "dev": true, "requires": { "@babel/types": "^7.3.0" } }, "@types/bluebird": { - "version": "3.5.26", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.26.tgz", - "integrity": "sha512-aj2mrBLn5ky0GmAg6IPXrQjnN0iB/ulozuJ+oZdrHRAzRbXjGmu4UXsNCjFvPbSaaPZmniocdOzsM392qLOlmQ==", + "version": "3.5.27", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.27.tgz", + "integrity": "sha512-6BmYWSBea18+tSjjSC3QIyV93ZKAeNWGM7R6aYt1ryTZXrlHF+QLV0G2yV0viEGVyRkyQsWfMoJ0k/YghBX5sQ==", "dev": true }, + "@types/body-parser": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.0.tgz", + "integrity": "sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w==", + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, "@types/caseless": { "version": "0.12.2", "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.2.tgz", "integrity": "sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==", "dev": true }, - "@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==", - "dev": true, + "@types/connect": { + "version": "3.4.32", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.32.tgz", + "integrity": "sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg==", "requires": { "@types/node": "*" } }, + "@types/cookie-session": { + "version": "2.0.37", + "resolved": "https://registry.npmjs.org/@types/cookie-session/-/cookie-session-2.0.37.tgz", + "integrity": "sha512-h8uZLDGyfAgER6kHbHlYWm1g/P/7zCBMOW6yT5/fQydVJxByJD4tohSvHBzJrGoLVmQJefQdfwuNkKb23cq29Q==", + "requires": { + "@types/express": "*", + "@types/keygrip": "*" + } + }, + "@types/express": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.0.tgz", + "integrity": "sha512-CjaMu57cjgjuZbh9DpkloeGxV45CnMGlVd+XpG7Gm9QgVrd7KFq+X4HY0vM+2v0bczS48Wg7bvnMY5TN+Xmcfw==", + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.16.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.7.tgz", + "integrity": "sha512-847KvL8Q1y3TtFLRTXcVakErLJQgdpFSaq+k043xefz9raEf0C7HalpSY7OW5PyjCnY8P7bPW5t/Co9qqp+USg==", + "requires": { + "@types/node": "*", + "@types/range-parser": "*" + } + }, "@types/istanbul-lib-coverage": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.0.tgz", - "integrity": "sha512-eAtOAFZefEnfJiRFQBGw1eYqa5GTLCZ1y86N0XSI/D6EB+E8z6VPV/UL7Gi5UEclFqoQk+6NRqEDsfmDLXn8sg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==", "dev": true }, + "@types/istanbul-lib-report": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz", + "integrity": "sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz", + "integrity": "sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*", + "@types/istanbul-lib-report": "*" + } + }, "@types/jest": { "version": "23.3.14", "resolved": "https://registry.npmjs.org/@types/jest/-/jest-23.3.14.tgz", "integrity": "sha512-Q5hTcfdudEL2yOmluA1zaSyPbzWPmJ3XfSWeP3RyoYvS9hnje1ZyagrZOuQ6+1nQC1Gw+7gap3pLNL3xL6UBug==", "dev": true }, + "@types/keygrip": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.1.tgz", + "integrity": "sha1-/1QEYtL7TQqIRBzq8n0oewHD2Hg=" + }, + "@types/mime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz", + "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==" + }, "@types/nock": { "version": "9.3.1", "resolved": "https://registry.npmjs.org/@types/nock/-/nock-9.3.1.tgz", @@ -735,33 +919,95 @@ } }, "@types/node": { - "version": "10.14.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.4.tgz", - "integrity": "sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg==", - "dev": true + "version": "10.14.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.15.tgz", + "integrity": "sha512-CBR5avlLcu0YCILJiDIXeU2pTw7UK/NIxfC63m7d7CVamho1qDEzXKkOtEauQRPMy6MI8mLozth+JJkas7HY6g==" + }, + "@types/oauth": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@types/oauth/-/oauth-0.9.1.tgz", + "integrity": "sha512-a1iY62/a3yhZ7qH7cNUsxoI3U/0Fe9+RnuFrpTKr+0WVOzbKlSLojShCKe20aOD1Sppv+i8Zlq0pLDuTJnwS4A==", + "requires": { + "@types/node": "*" + } + }, + "@types/passport": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/passport/-/passport-1.0.0.tgz", + "integrity": "sha512-R2FXqM+AgsMIym0PuKj08Ybx+GR6d2rU3b1/8OcHolJ+4ga2pRPX105wboV6hq1AJvMo2frQzYKdqXS5+4cyMw==", + "requires": { + "@types/express": "*" + } + }, + "@types/passport-github": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@types/passport-github/-/passport-github-1.1.5.tgz", + "integrity": "sha512-BeWDdLRWfPpJcmT1XofY5r1Av//TcxBEgllY4LnArcYdGqbIIVLyHwR+8bIG+ZC4PwJ6W1trnVEG3EQ+5J+Jmw==", + "requires": { + "@types/express": "*", + "@types/passport": "*", + "@types/passport-oauth2": "*" + } + }, + "@types/passport-oauth2": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/@types/passport-oauth2/-/passport-oauth2-1.4.8.tgz", + "integrity": "sha512-tlX16wyFE5YJR2pHpZ308dgB1MV9/Ra2wfQh71eWk+/umPoD1Rca2D4N5M27W7nZm1wqUNGTk1I864nHvEgiFA==", + "requires": { + "@types/express": "*", + "@types/oauth": "*", + "@types/passport": "*" + } + }, + "@types/range-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", + "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==" }, "@types/request": { - "version": "2.48.1", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.1.tgz", - "integrity": "sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg==", + "version": "2.48.2", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.2.tgz", + "integrity": "sha512-gP+PSFXAXMrd5PcD7SqHeUjdGshAI8vKQ3+AvpQr3ht9iQea+59LOKvKITcQI+Lg+1EIkDP6AFSBUJPWG8GDyA==", "dev": true, "requires": { "@types/caseless": "*", - "@types/form-data": "*", "@types/node": "*", - "@types/tough-cookie": "*" + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + }, + "dependencies": { + "form-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.0.tgz", + "integrity": "sha512-WXieX3G/8side6VIqx44ablyULoGruSde5PNTxoUyo5CeyAMX6nVWUd0rgist/EuX655cjhUhTo1Fo3tRYqbcA==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + } } }, "@types/request-promise": { - "version": "4.1.42", - "resolved": "https://registry.npmjs.org/@types/request-promise/-/request-promise-4.1.42.tgz", - "integrity": "sha512-b8li55sEZ00BXZstZ3d8WOi48dnapTqB1VufEG9Qox0nVI2JVnTVT1Mw4JbBa1j+1sGVX/qJ0R4WDv4v2GjT0w==", + "version": "4.1.44", + "resolved": "https://registry.npmjs.org/@types/request-promise/-/request-promise-4.1.44.tgz", + "integrity": "sha512-RId7eFsUKxfal1LirDDIcOp9u3MM3NXFDBcC3sqIMcmu7f4U6DsCEMD8RbLZtnPrQlN5Jc79di/WPsIEDO4keg==", "dev": true, "requires": { "@types/bluebird": "*", "@types/request": "*" } }, + "@types/serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-/BZ4QRLpH/bNYgZgwhKEh+5AsboDBcUdlBYgzoLX0fpj3Y2gp6EApyOlM3bK53wQS/OE1SrdSYBAbux2D1528Q==", + "requires": { + "@types/express-serve-static-core": "*", + "@types/mime": "*" + } + }, "@types/stack-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", @@ -786,10 +1032,10 @@ "dev": true }, "abab": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", - "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", - "optional": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", + "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", + "dev": true }, "abbrev": { "version": "1.1.1", @@ -807,17 +1053,27 @@ } }, "acorn": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz", - "integrity": "sha1-q259nYhqrKiwhbwzEreaGYQz8Oc=" + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true }, "acorn-globals": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-1.0.9.tgz", - "integrity": "sha1-VbtemGkVB7dFedBRNBMhfDgMVM8=", - "optional": true, + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.3.tgz", + "integrity": "sha512-vkR40VwS2SYO98AIeFvzWWh+xyc2qi9s7OoXSFEGIP/rOJKzjnhykaZJNnHdoq4BL2gGxI5EZOU16z896EYnOQ==", + "dev": true, "requires": { - "acorn": "^2.1.0" + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + }, + "dependencies": { + "acorn": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", + "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", + "dev": true + } } }, "acorn-jsx": { @@ -838,23 +1094,24 @@ } }, "acorn-walk": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", - "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", + "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", "dev": true }, "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", "requires": { "es6-promisify": "^5.0.0" } }, "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "dev": true, "requires": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", @@ -886,12 +1143,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=" + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true }, "ansicolors": { "version": "0.2.1", @@ -913,15 +1172,6 @@ "normalize-path": "^2.1.1" } }, - "append-transform": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", - "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", - "dev": true, - "requires": { - "default-require-extensions": "^2.0.0" - } - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -975,32 +1225,36 @@ "es-abstract": "^1.7.0" } }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, "requires": { "safer-buffer": "~2.1.0" } }, "assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", "requires": { + "object-assign": "^4.1.1", "util": "0.10.3" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + } } }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true }, "assertion-error": { "version": "1.1.0", @@ -1026,15 +1280,15 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, "async-each": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.2.tgz", - "integrity": "sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", "dev": true }, "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", "dev": true }, "asynckit": { @@ -1051,12 +1305,14 @@ "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true }, "aws4": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true }, "babel-code-frame": { "version": "6.26.0", @@ -1078,13 +1334,13 @@ } }, "babel-jest": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.7.1.tgz", - "integrity": "sha512-GPnLqfk8Mtt0i4OemjWkChi73A3ALs4w2/QbG64uAj8b5mmwzxc7jbJVRZt8NJkxi6FopVHog9S3xX6UJKb2qg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.8.0.tgz", + "integrity": "sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw==", "dev": true, "requires": { - "@jest/transform": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", "@types/babel__core": "^7.1.0", "babel-plugin-istanbul": "^5.1.0", "babel-preset-jest": "^24.6.0", @@ -1124,14 +1380,15 @@ } }, "babel-plugin-istanbul": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz", - "integrity": "sha512-RNNVv2lsHAXJQsEJ5jonQwrJVWK8AcZpG1oxhnjCUaAjL7xahYLANhPUZbzEQHjKy1NMYUwn+0NPKQc8iSY4xQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz", + "integrity": "sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw==", "dev": true, "requires": { + "@babel/helper-plugin-utils": "^7.0.0", "find-up": "^3.0.0", - "istanbul-lib-instrument": "^3.0.0", - "test-exclude": "^5.0.0" + "istanbul-lib-instrument": "^3.3.0", + "test-exclude": "^5.2.3" }, "dependencies": { "find-up": { @@ -1143,6 +1400,27 @@ "locate-path": "^3.0.0" } }, + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "dev": true, + "requires": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" + } + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -1176,6 +1454,12 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true } } }, @@ -1264,6 +1548,11 @@ } } }, + "base64url": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-3.0.1.tgz", + "integrity": "sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==" + }, "basic-auth": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", @@ -1274,14 +1563,15 @@ } }, "batch": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.5.3.tgz", - "integrity": "sha1-PzQU84AyF0O/wQQvmoP/HVgk1GQ=" + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=" }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, "requires": { "tweetnacl": "^0.14.3" } @@ -1303,34 +1593,48 @@ "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==" }, "body-parser": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", - "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "requires": { - "bytes": "3.0.0", + "bytes": "3.1.0", "content-type": "~1.0.4", "debug": "2.6.9", "depd": "~1.1.2", - "http-errors": "~1.6.3", - "iconv-lite": "0.4.23", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", "on-finished": "~2.3.0", - "qs": "6.5.2", - "raw-body": "2.3.3", - "type-is": "~1.6.16" + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" }, "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "requires": { - "ms": "2.0.0" + "mime-db": "1.40.0" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } } } }, @@ -1340,9 +1644,9 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" }, "bottleneck": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.17.1.tgz", - "integrity": "sha512-ARJKJRNq6+W7BBYZnkqA1F4+HDclht7QyRJl2haAVtD7xBTG8Prpy6huO+canGLUxZaRrek8U/0NjTvoXACsaQ==" + "version": "2.19.5", + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" }, "boxen": { "version": "1.3.0", @@ -1473,9 +1777,9 @@ } }, "bser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", - "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.0.tgz", + "integrity": "sha512-8zsjWrQkkBoLK6uxASk1nJ2SKv97ltiGDo6A3wA0/yRPz+CwmEyDo0hUrhIuukG2JHpAl3bvFIixw2/3Hi0DOg==", "dev": true, "requires": { "node-int64": "^0.4.0" @@ -1533,9 +1837,9 @@ } }, "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" }, "cache-base": { "version": "1.0.1", @@ -1563,12 +1867,23 @@ } }, "cache-manager": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/cache-manager/-/cache-manager-2.9.0.tgz", - "integrity": "sha1-Xh9jF8oaJeQN3zZacWJ1evFSNT4=", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/cache-manager/-/cache-manager-2.10.0.tgz", + "integrity": "sha512-IuPx05r5L0uZyBDYicB2Llld1o+/1WYjoHUnrC0TNQejMAnkoYxYS9Y8Uwr+lIBytDiyu7dwwmBCup2M9KugwQ==", "requires": { "async": "1.5.2", "lru-cache": "4.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.0.tgz", + "integrity": "sha1-tcvwFVbBaWb+vlTO7A+03JDfbCg=", + "requires": { + "pseudomap": "^1.0.1", + "yallist": "^2.0.0" + } + } } }, "caller-path": { @@ -1618,7 +1933,8 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true }, "chai": { "version": "4.2.0", @@ -1638,6 +1954,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.2", @@ -1658,22 +1975,32 @@ "dev": true }, "cheerio": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.20.0.tgz", - "integrity": "sha1-XHEPK6uVZTJyhCugHG6mGzVF7DU=", + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", + "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", "requires": { "css-select": "~1.2.0", "dom-serializer": "~0.1.0", "entities": "~1.1.1", - "htmlparser2": "~3.8.1", - "jsdom": "^7.0.2", - "lodash": "^4.1.0" + "htmlparser2": "^3.9.1", + "lodash.assignin": "^4.0.9", + "lodash.bind": "^4.1.4", + "lodash.defaults": "^4.0.1", + "lodash.filter": "^4.4.0", + "lodash.flatten": "^4.2.0", + "lodash.foreach": "^4.3.0", + "lodash.map": "^4.4.0", + "lodash.merge": "^4.4.0", + "lodash.pick": "^4.2.1", + "lodash.reduce": "^4.4.0", + "lodash.reject": "^4.4.0", + "lodash.some": "^4.4.0" } }, "chokidar": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz", - "integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==", + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", + "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", "dev": true, "requires": { "anymatch": "^2.0.0", @@ -1813,7 +2140,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -1821,8 +2147,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "combined-stream": { "version": "1.0.7", @@ -1837,12 +2162,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==" }, - "compare-versions": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.4.0.tgz", - "integrity": "sha512-tK69D7oNXXqUW3ZNo/z7NXTEz22TCF0pTE+YF9cxvaAM9XnkLo1fV621xCLrRR6aevJlKxExkss0vWqUCUpqdg==", - "dev": true - }, "component-emitter": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", @@ -1909,6 +2228,17 @@ "unique-string": "^1.0.0", "write-file-atomic": "^2.0.0", "xdg-basedir": "^3.0.0" + }, + "dependencies": { + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + } } }, "contains-path": { @@ -1940,9 +2270,19 @@ } }, "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" + }, + "cookie-session": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/cookie-session/-/cookie-session-1.3.3.tgz", + "integrity": "sha512-GrMdrU1YTQWtmVTo0Rj3peeZRMc2xJrBslFYtZcYTo+hrSLmrcf69OrRkDi84xTfylgCy2wgpRHyY4le6lE5+A==", + "requires": { + "cookies": "0.7.3", + "debug": "2.6.9", + "on-headers": "~1.0.2" + } }, "cookie-signature": { "version": "1.0.6", @@ -1954,6 +2294,15 @@ "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" }, + "cookies": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.7.3.tgz", + "integrity": "sha512-+gixgxYSgQLTaTIilDHAdlNPZDENDQernEMiIcZpYYP14zgHsCt4Ce1FEjFtcp6GefhozebB6orvhAAWx/IS0A==", + "requires": { + "depd": "~1.1.2", + "keygrip": "~1.0.3" + } + }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -2014,15 +2363,16 @@ "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==" }, "cssom": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.6.tgz", - "integrity": "sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A==" + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true }, "cssstyle": { - "version": "0.2.37", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", - "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", - "optional": true, + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.4.0.tgz", + "integrity": "sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA==", + "dev": true, "requires": { "cssom": "0.3.x" } @@ -2040,6 +2390,7 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -2055,27 +2406,6 @@ "whatwg-url": "^7.0.0" }, "dependencies": { - "abab": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", - "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", - "dev": true - }, - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, "whatwg-url": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", @@ -2090,11 +2420,18 @@ } }, "debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { - "ms": "0.7.1" + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } } }, "debug-log": { @@ -2139,16 +2476,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=" - }, - "default-require-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", - "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", - "dev": true, - "requires": { - "strip-bom": "^3.0.0" - } + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true }, "define-properties": { "version": "1.1.3", @@ -2306,20 +2635,12 @@ "dev": true, "requires": { "webidl-conversions": "^4.0.2" - }, - "dependencies": { - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - } } }, "domhandler": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", - "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", "requires": { "domelementtype": "1" } @@ -2366,6 +2687,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -2506,9 +2828,9 @@ } }, "es6-promise": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", - "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==" + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" }, "es6-promisify": { "version": "5.0.0", @@ -2564,9 +2886,10 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz", - "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.12.0.tgz", + "integrity": "sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg==", + "dev": true, "requires": { "esprima": "^3.1.3", "estraverse": "^4.2.0", @@ -2841,7 +3164,8 @@ "esprima": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true }, "esquery": { "version": "1.0.1", @@ -2864,12 +3188,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", @@ -2942,15 +3268,6 @@ "to-regex": "^3.0.1" }, "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", @@ -2968,26 +3285,20 @@ "requires": { "is-extendable": "^0.1.0" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true } } }, "expect": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-24.7.1.tgz", - "integrity": "sha512-mGfvMTPduksV3xoI0xur56pQsg2vJjNf5+a+bXOjqCkiCBbmCayrBbHS/75y9K430cfqyocPr2ZjiNiRx4SRKw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-24.8.0.tgz", + "integrity": "sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA==", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "ansi-styles": "^3.2.0", - "jest-get-type": "^24.3.0", - "jest-matcher-utils": "^24.7.0", - "jest-message-util": "^24.7.1", + "jest-get-type": "^24.8.0", + "jest-matcher-utils": "^24.8.0", + "jest-message-util": "^24.8.0", "jest-regex-util": "^24.3.0" }, "dependencies": { @@ -3003,64 +3314,87 @@ } }, "express": { - "version": "4.16.4", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", - "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", "requires": { - "accepts": "~1.3.5", + "accepts": "~1.3.7", "array-flatten": "1.1.1", - "body-parser": "1.18.3", - "content-disposition": "0.5.2", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", "content-type": "~1.0.4", - "cookie": "0.3.1", + "cookie": "0.4.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.1.1", + "finalhandler": "~1.1.2", "fresh": "0.5.2", "merge-descriptors": "1.0.1", "methods": "~1.1.2", "on-finished": "~2.3.0", - "parseurl": "~1.3.2", + "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.4", - "qs": "6.5.2", - "range-parser": "~1.2.0", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", "safe-buffer": "5.1.2", - "send": "0.16.2", - "serve-static": "1.13.2", - "setprototypeof": "1.1.0", - "statuses": "~1.4.0", - "type-is": "~1.6.16", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" }, "dependencies": { - "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "requires": { - "ms": "2.0.0" + "mime-db": "1.40.0" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } } } }, @@ -3163,22 +3497,26 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true }, "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 }, "fb-watchman": { "version": "2.0.0", @@ -3217,32 +3555,6 @@ "object-assign": "^4.0.1" } }, - "fileset": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", - "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", - "dev": true, - "requires": { - "glob": "^7.0.3", - "minimatch": "^3.0.3" - }, - "dependencies": { - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -3267,36 +3579,23 @@ } }, "finalhandler": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "requires": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.4.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", "unpipe": "~1.0.0" }, "dependencies": { - "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" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" } } }, @@ -3365,7 +3664,8 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true }, "form-data": { "version": "2.3.3", @@ -3413,14 +3713,14 @@ "dev": true }, "fsevents": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", - "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", "dev": true, "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" }, "dependencies": { "abbrev": { @@ -3492,12 +3792,12 @@ "optional": true }, "debug": { - "version": "2.6.9", + "version": "4.1.1", "bundled": true, "dev": true, "optional": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "deep-extend": { @@ -3662,24 +3962,24 @@ } }, "ms": { - "version": "2.0.0", + "version": "2.1.1", "bundled": true, "dev": true, "optional": true }, "needle": { - "version": "2.2.4", + "version": "2.3.0", "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "^2.1.2", + "debug": "^4.1.0", "iconv-lite": "^0.4.4", "sax": "^1.2.4" } }, "node-pre-gyp": { - "version": "0.10.3", + "version": "0.12.0", "bundled": true, "dev": true, "optional": true, @@ -3707,13 +4007,13 @@ } }, "npm-bundled": { - "version": "1.0.5", + "version": "1.0.6", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.2.0", + "version": "1.4.1", "bundled": true, "dev": true, "optional": true, @@ -3849,7 +4149,7 @@ "optional": true }, "semver": { - "version": "5.6.0", + "version": "5.7.0", "bundled": true, "dev": true, "optional": true @@ -4001,19 +4301,21 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } }, "glob": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", - "optional": true, + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, "requires": { + "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "2 || 3", + "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -4092,6 +4394,13 @@ "integrity": "sha512-HO13qBGUb7jCztEJYVu+s7iLMgN+Hlbi5UeNT+Kw2TT/Wvzx52whwg172/xDufz2kOaXJkp4PXVTRMbDbQG1Vw==", "requires": { "lodash.merge": "4.6.1" + }, + "dependencies": { + "lodash.merge": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", + "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" + } } }, "growly": { @@ -4101,35 +4410,28 @@ "dev": true }, "handlebars": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.13.tgz", - "integrity": "sha512-uydY0jy4Z3wy/iGXsi64UtLD4t1fFJe16c/NFxsYE4WdQis8ZCzOXUZaPQNG0e5bgtLQV41QTfqBindhEjnpyQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", + "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "dev": true, "requires": { - "async": "^2.5.0", + "neo-async": "^2.6.0", "optimist": "^0.6.1", "source-map": "^0.6.1", "uglify-js": "^3.1.4" - }, - "dependencies": { - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "requires": { - "lodash": "^4.17.11" - } - } } }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true }, "har-validator": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, "requires": { "ajv": "^6.5.5", "har-schema": "^2.0.0" @@ -4148,6 +4450,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.0.0" } @@ -4198,24 +4501,45 @@ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "is-buffer": "^1.1.5" + } + } + } + }, + "hbs": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/hbs/-/hbs-4.0.4.tgz", + "integrity": "sha512-esVlyV/V59mKkwFai5YmPRSNIWZzhqL5YMN0++ueMxyK1cCfPa5f6JiHtapPKAIVAhQR6rpGxow0troav9WMEg==", + "requires": { + "handlebars": "4.0.14", + "walk": "2.3.9" + }, + "dependencies": { + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "handlebars": { + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.14.tgz", + "integrity": "sha512-E7tDoyAA8ilZIV3xDJgl18sX3M8xB9/fMw8+mfW4msLW8jlX97bAnWgT3pmaNXuvzIEgSBMnAHfuXsB2hdzfow==", + "requires": { + "async": "^2.5.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" } } } }, - "hbs": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/hbs/-/hbs-4.0.3.tgz", - "integrity": "sha512-u8AAbtYUWqNATGEruLdlyAbN+lOtKED+mn38t/13ZkeaKy5BObknFuL1Gtmj0QwXgcSizQ68FHOP1ZST/HP+dg==", - "requires": { - "handlebars": "4.0.13", - "walk": "2.3.9" - } - }, "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.4.tgz", + "integrity": "sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ==", "dev": true }, "html-encoding-sniffer": { @@ -4228,22 +4552,16 @@ } }, "htmlparser2": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", - "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", "requires": { - "domelementtype": "1", - "domhandler": "2.3", - "domutils": "1.5", - "entities": "1.0", - "readable-stream": "1.1" - }, - "dependencies": { - "entities": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", - "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" - } + "domelementtype": "^1.3.1", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.1.1" } }, "http-context": { @@ -4272,14 +4590,15 @@ } }, "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "requires": { "depd": "~1.1.2", "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" } }, "http-incoming": { @@ -4320,6 +4639,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -4327,11 +4647,11 @@ } }, "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", + "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", "requires": { - "agent-base": "^4.1.0", + "agent-base": "^4.3.0", "debug": "^3.1.0" }, "dependencies": { @@ -4342,18 +4662,13 @@ "requires": { "ms": "^2.1.1" } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" } } }, "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { "safer-buffer": ">= 2.1.2 < 3" } @@ -4483,9 +4798,9 @@ "dev": true }, "ipaddr.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" }, "is-accessor-descriptor": { "version": "0.1.6", @@ -4774,7 +5089,8 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "is-url": { "version": "1.2.4", @@ -4794,9 +5110,10 @@ "dev": true }, "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true }, "isexe": { "version": "2.0.0", @@ -4804,49 +5121,15 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.0.0.tgz", - "integrity": "sha1-II3ocr1zeMKpKvlCij9W65GhIsQ=", - "requires": { - "isarray": "0.0.1" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==" }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "istanbul-api": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.1.tgz", - "integrity": "sha512-kVmYrehiwyeBAk/wE71tW6emzLiHGjYIiDrc8sfyty4F8M02/lrgXSm+R1kXysmF20zArvmZXjlE/mg24TVPJw==", - "dev": true, - "requires": { - "async": "^2.6.1", - "compare-versions": "^3.2.1", - "fileset": "^2.0.3", - "istanbul-lib-coverage": "^2.0.3", - "istanbul-lib-hook": "^2.0.3", - "istanbul-lib-instrument": "^3.1.0", - "istanbul-lib-report": "^2.0.4", - "istanbul-lib-source-maps": "^3.0.2", - "istanbul-reports": "^2.1.1", - "js-yaml": "^3.12.0", - "make-dir": "^1.3.0", - "minimatch": "^3.0.4", - "once": "^1.4.0" - }, - "dependencies": { - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "dev": true, - "requires": { - "lodash": "^4.17.11" - } - } - } + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true }, "istanbul-lib-coverage": { "version": "2.0.3", @@ -4854,15 +5137,6 @@ "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", "dev": true }, - "istanbul-lib-hook": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.3.tgz", - "integrity": "sha512-CLmEqwEhuCYtGcpNVJjLV1DQyVnIqavMLFHV/DP+np/g3qvdxu3gsPqYoJMXm15sN84xOlckFB3VNvRbf5yEgA==", - "dev": true, - "requires": { - "append-transform": "^1.0.0" - } - }, "istanbul-lib-instrument": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz", @@ -4879,16 +5153,22 @@ } }, "istanbul-lib-report": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz", - "integrity": "sha512-sOiLZLAWpA0+3b5w5/dq0cjm2rrNdAfHWaGhmn7XEFW6X++IV9Ohn+pnELAl9K3rfpaeBfbmH9JU5sejacdLeA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", "dev": true, "requires": { - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "supports-color": "^6.0.0" + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "supports-color": "^6.1.0" }, "dependencies": { + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, "supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -4901,15 +5181,15 @@ } }, "istanbul-lib-source-maps": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz", - "integrity": "sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", "dev": true, "requires": { "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "rimraf": "^2.6.2", + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "rimraf": "^2.6.3", "source-map": "^0.6.1" }, "dependencies": { @@ -4922,68 +5202,31 @@ "ms": "^2.1.1" } }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", "dev": true - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } } } }, "istanbul-reports": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.1.1.tgz", - "integrity": "sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw==", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz", + "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==", "dev": true, "requires": { - "handlebars": "^4.1.0" - }, - "dependencies": { - "handlebars": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.1.tgz", - "integrity": "sha512-3Zhi6C0euYZL5sM0Zcy7lInLXKQ+YLcF/olbN010mzGQ4XVm50JeyBnMqofHh696GrciGruC7kCcApPDJvVgwA==", - "dev": true, - "requires": { - "neo-async": "^2.6.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - } - } + "handlebars": "^4.1.2" } }, "jest": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest/-/jest-24.7.1.tgz", - "integrity": "sha512-AbvRar5r++izmqo5gdbAjTeA6uNRGoNRuj5vHB0OnDXo2DXWZJVuaObiGgtlvhKb+cWy2oYbQSfxv7Q7GjnAtA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-24.8.0.tgz", + "integrity": "sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg==", "dev": true, "requires": { "import-local": "^2.0.0", - "jest-cli": "^24.7.1" + "jest-cli": "^24.8.0" }, "dependencies": { "ansi-styles": { @@ -5007,21 +5250,21 @@ } }, "jest-cli": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.7.1.tgz", - "integrity": "sha512-32OBoSCVPzcTslGFl6yVCMzB2SqX3IrWwZCY5mZYkb0D2WsogmU3eV2o8z7+gRQa4o4sZPX/k7GU+II7CxM6WQ==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.8.0.tgz", + "integrity": "sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA==", "dev": true, "requires": { - "@jest/core": "^24.7.1", - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/core": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", "exit": "^0.1.2", "import-local": "^2.0.0", "is-ci": "^2.0.0", - "jest-config": "^24.7.1", - "jest-util": "^24.7.1", - "jest-validate": "^24.7.0", + "jest-config": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", "prompts": "^2.0.1", "realpath-native": "^1.1.0", "yargs": "^12.0.2" @@ -5039,38 +5282,38 @@ } }, "jest-changed-files": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.7.0.tgz", - "integrity": "sha512-33BgewurnwSfJrW7T5/ZAXGE44o7swLslwh8aUckzq2e17/2Os1V0QU506ZNik3hjs8MgnEMKNkcud442NCDTw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.8.0.tgz", + "integrity": "sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug==", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "execa": "^1.0.0", "throat": "^4.0.0" } }, "jest-config": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.7.1.tgz", - "integrity": "sha512-8FlJNLI+X+MU37j7j8RE4DnJkvAghXmBWdArVzypW6WxfGuxiL/CCkzBg0gHtXhD2rxla3IMOSUAHylSKYJ83g==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.8.0.tgz", + "integrity": "sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^24.7.1", - "@jest/types": "^24.7.0", - "babel-jest": "^24.7.1", + "@jest/test-sequencer": "^24.8.0", + "@jest/types": "^24.8.0", + "babel-jest": "^24.8.0", "chalk": "^2.0.1", "glob": "^7.1.1", - "jest-environment-jsdom": "^24.7.1", - "jest-environment-node": "^24.7.1", - "jest-get-type": "^24.3.0", - "jest-jasmine2": "^24.7.1", + "jest-environment-jsdom": "^24.8.0", + "jest-environment-node": "^24.8.0", + "jest-get-type": "^24.8.0", + "jest-jasmine2": "^24.8.0", "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.7.1", - "jest-util": "^24.7.1", - "jest-validate": "^24.7.0", + "jest-resolve": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", "micromatch": "^3.1.10", - "pretty-format": "^24.7.0", + "pretty-format": "^24.8.0", "realpath-native": "^1.1.0" }, "dependencies": { @@ -5094,20 +5337,6 @@ "supports-color": "^5.3.0" } }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -5120,15 +5349,15 @@ } }, "jest-diff": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.7.0.tgz", - "integrity": "sha512-ULQZ5B1lWpH70O4xsANC4tf4Ko6RrpwhE3PtG6ERjMg1TiYTC2Wp4IntJVGro6a8HG9luYHhhmF4grF0Pltckg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.8.0.tgz", + "integrity": "sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g==", "dev": true, "requires": { "chalk": "^2.0.1", "diff-sequences": "^24.3.0", - "jest-get-type": "^24.3.0", - "pretty-format": "^24.7.0" + "jest-get-type": "^24.8.0", + "pretty-format": "^24.8.0" }, "dependencies": { "ansi-styles": { @@ -5172,16 +5401,16 @@ } }, "jest-each": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.7.1.tgz", - "integrity": "sha512-4fsS8fEfLa3lfnI1Jw6NxjhyRTgfpuOVTeUZZFyVYqeTa4hPhr2YkToUhouuLTrL2eMGOfpbdMyRx0GQ/VooKA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.8.0.tgz", + "integrity": "sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA==", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", - "jest-get-type": "^24.3.0", - "jest-util": "^24.7.1", - "pretty-format": "^24.7.0" + "jest-get-type": "^24.8.0", + "jest-util": "^24.8.0", + "pretty-format": "^24.8.0" }, "dependencies": { "ansi-styles": { @@ -5216,145 +5445,52 @@ } }, "jest-environment-jsdom": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.7.1.tgz", - "integrity": "sha512-Gnhb+RqE2JuQGb3kJsLF8vfqjt3PHKSstq4Xc8ic+ax7QKo4Z0RWGucU3YV+DwKR3T9SYc+3YCUQEJs8r7+Jxg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz", + "integrity": "sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ==", "dev": true, "requires": { - "@jest/environment": "^24.7.1", - "@jest/fake-timers": "^24.7.1", - "@jest/types": "^24.7.0", - "jest-mock": "^24.7.0", - "jest-util": "^24.7.1", + "@jest/environment": "^24.8.0", + "@jest/fake-timers": "^24.8.0", + "@jest/types": "^24.8.0", + "jest-mock": "^24.8.0", + "jest-util": "^24.8.0", "jsdom": "^11.5.1" - }, - "dependencies": { - "abab": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", - "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", - "dev": true - }, - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", - "dev": true - }, - "acorn-globals": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", - "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", - "dev": true, - "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - }, - "dependencies": { - "acorn": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", - "dev": true - } - } - }, - "cssstyle": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.2.tgz", - "integrity": "sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow==", - "dev": true, - "requires": { - "cssom": "0.3.x" - } - }, - "jsdom": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", - "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", - "dev": true, - "requires": { - "abab": "^2.0.0", - "acorn": "^5.5.3", - "acorn-globals": "^4.1.0", - "array-equal": "^1.0.0", - "cssom": ">= 0.3.2 < 0.4.0", - "cssstyle": "^1.0.0", - "data-urls": "^1.0.0", - "domexception": "^1.0.1", - "escodegen": "^1.9.1", - "html-encoding-sniffer": "^1.0.2", - "left-pad": "^1.3.0", - "nwsapi": "^2.0.7", - "parse5": "4.0.0", - "pn": "^1.1.0", - "request": "^2.87.0", - "request-promise-native": "^1.0.5", - "sax": "^1.2.4", - "symbol-tree": "^3.2.2", - "tough-cookie": "^2.3.4", - "w3c-hr-time": "^1.0.1", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.3", - "whatwg-mimetype": "^2.1.0", - "whatwg-url": "^6.4.1", - "ws": "^5.2.0", - "xml-name-validator": "^3.0.0" - } - }, - "parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", - "dev": true - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - } } }, "jest-environment-node": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.7.1.tgz", - "integrity": "sha512-GJJQt1p9/C6aj6yNZMvovZuxTUd+BEJprETdvTKSb4kHcw4mFj8777USQV0FJoJ4V3djpOwA5eWyPwfq//PFBA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.8.0.tgz", + "integrity": "sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q==", "dev": true, "requires": { - "@jest/environment": "^24.7.1", - "@jest/fake-timers": "^24.7.1", - "@jest/types": "^24.7.0", - "jest-mock": "^24.7.0", - "jest-util": "^24.7.1" + "@jest/environment": "^24.8.0", + "@jest/fake-timers": "^24.8.0", + "@jest/types": "^24.8.0", + "jest-mock": "^24.8.0", + "jest-util": "^24.8.0" } }, "jest-get-type": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.3.0.tgz", - "integrity": "sha512-HYF6pry72YUlVcvUx3sEpMRwXEWGEPlJ0bSPVnB3b3n++j4phUEoSPcS6GC0pPJ9rpyPSe4cb5muFo6D39cXow==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", + "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", "dev": true }, "jest-haste-map": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.7.1.tgz", - "integrity": "sha512-g0tWkzjpHD2qa03mTKhlydbmmYiA2KdcJe762SbfFo/7NIMgBWAA0XqQlApPwkWOF7Cxoi/gUqL0i6DIoLpMBw==", + "version": "24.8.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.8.1.tgz", + "integrity": "sha512-SwaxMGVdAZk3ernAx2Uv2sorA7jm3Kx+lR0grp6rMmnY06Kn/urtKx1LPN2mGTea4fCT38impYT28FfcLUhX0g==", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "anymatch": "^2.0.0", "fb-watchman": "^2.0.0", "fsevents": "^1.2.7", "graceful-fs": "^4.1.15", "invariant": "^2.2.4", "jest-serializer": "^24.4.0", - "jest-util": "^24.7.1", + "jest-util": "^24.8.0", "jest-worker": "^24.6.0", "micromatch": "^3.1.10", "sane": "^4.0.3", @@ -5362,26 +5498,26 @@ } }, "jest-jasmine2": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.7.1.tgz", - "integrity": "sha512-Y/9AOJDV1XS44wNwCaThq4Pw3gBPiOv/s6NcbOAkVRRUEPu+36L2xoPsqQXsDrxoBerqeyslpn2TpCI8Zr6J2w==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz", + "integrity": "sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong==", "dev": true, "requires": { "@babel/traverse": "^7.1.0", - "@jest/environment": "^24.7.1", - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/environment": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", "co": "^4.6.0", - "expect": "^24.7.1", + "expect": "^24.8.0", "is-generator-fn": "^2.0.0", - "jest-each": "^24.7.1", - "jest-matcher-utils": "^24.7.0", - "jest-message-util": "^24.7.1", - "jest-runtime": "^24.7.1", - "jest-snapshot": "^24.7.1", - "jest-util": "^24.7.1", - "pretty-format": "^24.7.0", + "jest-each": "^24.8.0", + "jest-matcher-utils": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-snapshot": "^24.8.0", + "jest-util": "^24.8.0", + "pretty-format": "^24.8.0", "throat": "^4.0.0" }, "dependencies": { @@ -5423,24 +5559,24 @@ } }, "jest-leak-detector": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.7.0.tgz", - "integrity": "sha512-zV0qHKZGXtmPVVzT99CVEcHE9XDf+8LwiE0Ob7jjezERiGVljmqKFWpV2IkG+rkFIEUHFEkMiICu7wnoPM/RoQ==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz", + "integrity": "sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g==", "dev": true, "requires": { - "pretty-format": "^24.7.0" + "pretty-format": "^24.8.0" } }, "jest-matcher-utils": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.7.0.tgz", - "integrity": "sha512-158ieSgk3LNXeUhbVJYRXyTPSCqNgVXOp/GT7O94mYd3pk/8+odKTyR1JLtNOQSPzNi8NFYVONtvSWA/e1RDXg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz", + "integrity": "sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw==", "dev": true, "requires": { "chalk": "^2.0.1", - "jest-diff": "^24.7.0", - "jest-get-type": "^24.3.0", - "pretty-format": "^24.7.0" + "jest-diff": "^24.8.0", + "jest-get-type": "^24.8.0", + "pretty-format": "^24.8.0" }, "dependencies": { "ansi-styles": { @@ -5475,14 +5611,14 @@ } }, "jest-message-util": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.7.1.tgz", - "integrity": "sha512-dk0gqVtyqezCHbcbk60CdIf+8UHgD+lmRHifeH3JRcnAqh4nEyPytSc9/L1+cQyxC+ceaeP696N4ATe7L+omcg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.8.0.tgz", + "integrity": "sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "@types/stack-utils": "^1.0.1", "chalk": "^2.0.1", "micromatch": "^3.1.10", @@ -5522,12 +5658,12 @@ } }, "jest-mock": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.7.0.tgz", - "integrity": "sha512-6taW4B4WUcEiT2V9BbOmwyGuwuAFT2G8yghF7nyNW1/2gq5+6aTqSPcS9lS6ArvEkX55vbPAS/Jarx5LSm4Fng==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.8.0.tgz", + "integrity": "sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A==", "dev": true, "requires": { - "@jest/types": "^24.7.0" + "@jest/types": "^24.8.0" } }, "jest-pnp-resolver": { @@ -5543,12 +5679,12 @@ "dev": true }, "jest-resolve": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.7.1.tgz", - "integrity": "sha512-Bgrc+/UUZpGJ4323sQyj85hV9d+ANyPNu6XfRDUcyFNX1QrZpSoM0kE4Mb2vZMAYTJZsBFzYe8X1UaOkOELSbw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.8.0.tgz", + "integrity": "sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw==", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "browser-resolve": "^1.11.3", "chalk": "^2.0.1", "jest-pnp-resolver": "^1.2.1", @@ -5587,38 +5723,38 @@ } }, "jest-resolve-dependencies": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.7.1.tgz", - "integrity": "sha512-2Eyh5LJB2liNzfk4eo7bD1ZyBbqEJIyyrFtZG555cSWW9xVHxII2NuOkSl1yUYTAYCAmM2f2aIT5A7HzNmubyg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz", + "integrity": "sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw==", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "jest-regex-util": "^24.3.0", - "jest-snapshot": "^24.7.1" + "jest-snapshot": "^24.8.0" } }, "jest-runner": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.7.1.tgz", - "integrity": "sha512-aNFc9liWU/xt+G9pobdKZ4qTeG/wnJrJna3VqunziDNsWT3EBpmxXZRBMKCsNMyfy+A/XHiV+tsMLufdsNdgCw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.8.0.tgz", + "integrity": "sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow==", "dev": true, "requires": { "@jest/console": "^24.7.1", - "@jest/environment": "^24.7.1", - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/environment": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "chalk": "^2.4.2", "exit": "^0.1.2", "graceful-fs": "^4.1.15", - "jest-config": "^24.7.1", + "jest-config": "^24.8.0", "jest-docblock": "^24.3.0", - "jest-haste-map": "^24.7.1", - "jest-jasmine2": "^24.7.1", - "jest-leak-detector": "^24.7.0", - "jest-message-util": "^24.7.1", - "jest-resolve": "^24.7.1", - "jest-runtime": "^24.7.1", - "jest-util": "^24.7.1", + "jest-haste-map": "^24.8.0", + "jest-jasmine2": "^24.8.0", + "jest-leak-detector": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-resolve": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-util": "^24.8.0", "jest-worker": "^24.6.0", "source-map-support": "^0.5.6", "throat": "^4.0.0" @@ -5656,30 +5792,30 @@ } }, "jest-runtime": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.7.1.tgz", - "integrity": "sha512-0VAbyBy7tll3R+82IPJpf6QZkokzXPIS71aDeqh+WzPRXRCNz6StQ45otFariPdJ4FmXpDiArdhZrzNAC3sj6A==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.8.0.tgz", + "integrity": "sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA==", "dev": true, "requires": { "@jest/console": "^24.7.1", - "@jest/environment": "^24.7.1", + "@jest/environment": "^24.8.0", "@jest/source-map": "^24.3.0", - "@jest/transform": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", "@types/yargs": "^12.0.2", "chalk": "^2.0.1", "exit": "^0.1.2", "glob": "^7.1.3", "graceful-fs": "^4.1.15", - "jest-config": "^24.7.1", - "jest-haste-map": "^24.7.1", - "jest-message-util": "^24.7.1", - "jest-mock": "^24.7.0", + "jest-config": "^24.8.0", + "jest-haste-map": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-mock": "^24.8.0", "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.7.1", - "jest-snapshot": "^24.7.1", - "jest-util": "^24.7.1", - "jest-validate": "^24.7.0", + "jest-resolve": "^24.8.0", + "jest-snapshot": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", "realpath-native": "^1.1.0", "slash": "^2.0.0", "strip-bom": "^3.0.0", @@ -5706,20 +5842,6 @@ "supports-color": "^5.3.0" } }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -5738,22 +5860,22 @@ "dev": true }, "jest-snapshot": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.7.1.tgz", - "integrity": "sha512-8Xk5O4p+JsZZn4RCNUS3pxA+ORKpEKepE+a5ejIKrId9CwrVN0NY+vkqEkXqlstA5NMBkNahXkR/4qEBy0t5yA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.8.0.tgz", + "integrity": "sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg==", "dev": true, "requires": { "@babel/types": "^7.0.0", - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", - "expect": "^24.7.1", - "jest-diff": "^24.7.0", - "jest-matcher-utils": "^24.7.0", - "jest-message-util": "^24.7.1", - "jest-resolve": "^24.7.1", + "expect": "^24.8.0", + "jest-diff": "^24.8.0", + "jest-matcher-utils": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-resolve": "^24.8.0", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "pretty-format": "^24.7.0", + "pretty-format": "^24.8.0", "semver": "^5.5.0" }, "dependencies": { @@ -5789,16 +5911,16 @@ } }, "jest-util": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.7.1.tgz", - "integrity": "sha512-/KilOue2n2rZ5AnEBYoxOXkeTu6vi7cjgQ8MXEkih0oeAXT6JkS3fr7/j8+engCjciOU1Nq5loMSKe0A1oeX0A==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.8.0.tgz", + "integrity": "sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA==", "dev": true, "requires": { "@jest/console": "^24.7.1", - "@jest/fake-timers": "^24.7.1", + "@jest/fake-timers": "^24.8.0", "@jest/source-map": "^24.3.0", - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "callsites": "^3.0.0", "chalk": "^2.0.1", "graceful-fs": "^4.1.15", @@ -5840,17 +5962,17 @@ } }, "jest-validate": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.7.0.tgz", - "integrity": "sha512-cgai/gts9B2chz1rqVdmLhzYxQbgQurh1PEQSvSgPZ8KGa1AqXsqC45W5wKEwzxKrWqypuQrQxnF4+G9VejJJA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz", + "integrity": "sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "camelcase": "^5.0.0", "chalk": "^2.0.1", - "jest-get-type": "^24.3.0", + "jest-get-type": "^24.8.0", "leven": "^2.1.0", - "pretty-format": "^24.7.0" + "pretty-format": "^24.8.0" }, "dependencies": { "ansi-styles": { @@ -5885,17 +6007,17 @@ } }, "jest-watcher": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.7.1.tgz", - "integrity": "sha512-Wd6TepHLRHVKLNPacEsBwlp9raeBIO+01xrN24Dek4ggTS8HHnOzYSFnvp+6MtkkJ3KfMzy220KTi95e2rRkrw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.8.0.tgz", + "integrity": "sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw==", "dev": true, "requires": { - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "@types/yargs": "^12.0.9", "ansi-escapes": "^3.0.0", "chalk": "^2.0.1", - "jest-util": "^24.7.1", + "jest-util": "^24.8.0", "string-length": "^2.0.0" }, "dependencies": { @@ -5976,29 +6098,41 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true }, "jsdom": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-7.2.2.tgz", - "integrity": "sha1-QLQCdwwr2iNGkJa+6Rq2deOx/G4=", - "optional": true, + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", + "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", + "dev": true, "requires": { - "abab": "^1.0.0", - "acorn": "^2.4.0", - "acorn-globals": "^1.0.4", - "cssom": ">= 0.3.0 < 0.4.0", - "cssstyle": ">= 0.2.29 < 0.3.0", - "escodegen": "^1.6.1", - "nwmatcher": ">= 1.3.7 < 2.0.0", - "parse5": "^1.5.1", - "request": "^2.55.0", - "sax": "^1.1.4", - "symbol-tree": ">= 3.1.0 < 4.0.0", - "tough-cookie": "^2.2.0", - "webidl-conversions": "^2.0.0", - "whatwg-url-compat": "~0.6.5", - "xml-name-validator": ">= 2.0.1 < 3.0.0" + "abab": "^2.0.0", + "acorn": "^5.5.3", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": "^1.0.0", + "data-urls": "^1.0.0", + "domexception": "^1.0.1", + "escodegen": "^1.9.1", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.3.0", + "nwsapi": "^2.0.7", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.87.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.4", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.1", + "ws": "^5.2.0", + "xml-name-validator": "^3.0.0" } }, "jsesc": { @@ -6015,12 +6149,14 @@ "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "json-stable-stringify": { "version": "1.0.1", @@ -6034,7 +6170,8 @@ "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true }, "json5": { "version": "2.1.0", @@ -6080,19 +6217,13 @@ "lodash.once": "^4.0.0", "ms": "^2.1.1", "semver": "^5.6.0" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - } } }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -6125,6 +6256,11 @@ "safe-buffer": "^5.0.1" } }, + "keygrip": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.0.3.tgz", + "integrity": "sha512-/PpesirAIfaklxUzp4Yb7xBper9MwP6hNRA6BGGUFCgbJ+BM5CKBtsoxinNXkLHAr+GXS1/lSlF2rP7cv5Fl+g==" + }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -6176,6 +6312,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" @@ -6215,9 +6352,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, "lodash.assignin": { "version": "4.2.0", @@ -6291,9 +6428,9 @@ "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" }, "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "lodash.omit": { "version": "4.5.0", @@ -6353,26 +6490,36 @@ "dev": true }, "lru-cache": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.0.tgz", - "integrity": "sha1-tcvwFVbBaWb+vlTO7A+03JDfbCg=", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, "requires": { - "pseudomap": "^1.0.1", - "yallist": "^2.0.0" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "macos-release": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.2.0.tgz", - "integrity": "sha512-iV2IDxZaX8dIcM7fG6cI46uNmHUxHE4yN+Z8tKHAW1TBPMZDIKHf/3L+YnOuj/FK9il14UaVdHmiQ1tsi90ltA==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", + "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==" }, "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, "requires": { - "pify": "^3.0.0" + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } } }, "make-error": { @@ -6454,12 +6601,6 @@ "readable-stream": "^2.0.1" }, "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "readable-stream": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", @@ -6550,9 +6691,9 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -6620,9 +6761,9 @@ } }, "ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "mute-stream": { "version": "0.0.5", @@ -6639,12 +6780,36 @@ "mkdirp": "~0.5.1", "ncp": "~2.0.0", "rimraf": "~2.4.0" + }, + "dependencies": { + "glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "optional": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "rimraf": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", + "integrity": "sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=", + "optional": true, + "requires": { + "glob": "^6.0.1" + } + } } }, "nan": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", "optional": true }, "nanomatch": { @@ -6684,9 +6849,9 @@ "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" }, "neo-async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", - "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, "next-tick": { @@ -6752,9 +6917,9 @@ "dev": true }, "node-notifier": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.0.tgz", - "integrity": "sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.1.tgz", + "integrity": "sha512-p52B+onAEHKW1OF9MGO/S7k/ahGEHfhP5/tvwYzog/5XLYOd8ZuD6vdNZdUuWMONRnKPneXV43v3s6Snx1wsCQ==", "dev": true, "requires": { "growly": "^1.3.0", @@ -6775,9 +6940,9 @@ } }, "nodemon": { - "version": "1.18.11", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.11.tgz", - "integrity": "sha512-KdN3tm1zkarlqNo4+W9raU3ihM4H15MVMSE/f9rYDZmFgDHAfAJsomYrHhApAkuUemYjFyEeXlpCOQ2v5gtBEw==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.1.tgz", + "integrity": "sha512-/DXLzd/GhiaDXXbGId5BzxP1GlsqtMGM9zTmkWrgXtSqjKmGSbLicM/oAy4FR0YWm14jCHRwnR31AHS2dYFHrg==", "dev": true, "requires": { "chokidar": "^2.1.5", @@ -6801,12 +6966,6 @@ "ms": "^2.1.1" } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -6870,16 +7029,10 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, - "nwmatcher": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz", - "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==", - "optional": true - }, "nwsapi": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.3.tgz", - "integrity": "sha512-RowAaJGEgYXEZfQ7tvvdtAQUKPyTR6T6wNu0fwlNsGQYr/h3yQc6oI8WnVZh3Y/Sylwc+dtAlvPqfFZjhTyk3A==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz", + "integrity": "sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw==", "dev": true }, "nyc": { @@ -7916,15 +8069,22 @@ } } }, + "oauth": { + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/oauth/-/oauth-0.9.15.tgz", + "integrity": "sha1-vR/vr2hslrdUda7VGWQS/2DPucE=" + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true }, "object-assign": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.0.1.tgz", - "integrity": "sha1-mVBEVsNZi1ytT8WcJuipuxB/4L0=" + "integrity": "sha1-mVBEVsNZi1ytT8WcJuipuxB/4L0=", + "dev": true }, "object-copy": { "version": "0.1.0", @@ -8037,8 +8197,7 @@ "on-headers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "dev": true + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" }, "once": { "version": "1.4.0", @@ -8074,6 +8233,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.4", @@ -8193,10 +8353,10 @@ } }, "parse5": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-1.5.1.tgz", - "integrity": "sha1-m387DeMr543CQBsXVzzK8Pb1nZQ=", - "optional": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true }, "parseurl": { "version": "1.3.2", @@ -8209,6 +8369,40 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, + "passport": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/passport/-/passport-0.4.0.tgz", + "integrity": "sha1-xQlWkTR71a07XhgCOMORTRbwWBE=", + "requires": { + "passport-strategy": "1.x.x", + "pause": "0.0.1" + } + }, + "passport-github": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/passport-github/-/passport-github-1.1.0.tgz", + "integrity": "sha1-jOHj/NYa11eOsd9ZWDnkrqEjVdQ=", + "requires": { + "passport-oauth2": "1.x.x" + } + }, + "passport-oauth2": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/passport-oauth2/-/passport-oauth2-1.5.0.tgz", + "integrity": "sha512-kqBt6vR/5VlCK8iCx1/KpY42kQ+NEHZwsSyt4Y6STiNjU+wWICG1i8ucc1FapXDGO15C5O5VZz7+7vRzrDPXXQ==", + "requires": { + "base64url": "3.x.x", + "oauth": "0.9.x", + "passport-strategy": "1.x.x", + "uid2": "0.0.x", + "utils-merge": "1.x.x" + } + }, + "passport-strategy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", + "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=" + }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -8261,10 +8455,16 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, + "pause": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", + "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true }, "pify": { "version": "3.0.0", @@ -8428,7 +8628,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", @@ -8437,12 +8638,12 @@ "dev": true }, "pretty-format": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.7.0.tgz", - "integrity": "sha512-apen5cjf/U4dj7tHetpC7UEFCvtAgnNZnBDkfPv3fokzIqyOJckAG9OlAPC1BlFALnqT/lGB2tl9EJjlK6eCsA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", + "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "ansi-regex": "^4.0.0", "ansi-styles": "^3.2.0", "react-is": "^16.8.4" @@ -8466,12 +8667,12 @@ } }, "probot": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/probot/-/probot-7.5.1.tgz", - "integrity": "sha512-nbIQYX30kS0uN3hchTMCm9W6U6o3dnigr6bEpyAPJITycBMAortiZZZpuz3NSWxJ3aysASM29YJTuq+N7Ztjzw==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/probot/-/probot-7.5.3.tgz", + "integrity": "sha512-1ZMG3iy/daQbscFnQ8szzJYOqUvTpojdOzCCQce0Uh/TCY0YhPuT0WWSKWo5PQLJdQcOacxpiwMOn5KulZdG9g==", "requires": { "@octokit/rest": "^15.18.0", - "@octokit/webhooks": "^5.0.2", + "@octokit/webhooks": "^6.0.1", "@types/supports-color": "^5.3.0", "bottleneck": "^2.8.0", "bunyan": "^1.8.12", @@ -8484,7 +8685,7 @@ "express-async-errors": "^3.0.0", "hbs": "^4.0.3", "is-base64": "0.1.0", - "js-yaml": "^3.9.1", + "js-yaml": "^3.13.1", "jsonwebtoken": "^8.1.0", "pkg-conf": "^2.0.0", "promise-events": "^0.1.3", @@ -8519,9 +8720,9 @@ "dev": true }, "promise-events": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/promise-events/-/promise-events-0.1.4.tgz", - "integrity": "sha1-PIj66X5EjaaPf88Z1O4wjW5DLVs=" + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/promise-events/-/promise-events-0.1.6.tgz", + "integrity": "sha512-DD49dV22rZRttJbX7tpYU4I+kJoe6M1qShRV0EiaLnp6waHhdx9oDbgcspUZl0cOtyT/YnKZqJVUsf05pqFCrQ==" }, "promise-polyfill": { "version": "1.1.6", @@ -8529,13 +8730,13 @@ "integrity": "sha1-zQTv9G9clcOn0EVZHXm14+AfEtc=" }, "prompts": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.0.4.tgz", - "integrity": "sha512-HTzM3UWp/99A0gk51gAegwo1QRYA7xjcZufMNe33rCclFszUYAuHe1fIN/3ZmiHeGPkUsNaRyQm1hHOfM0PKxA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.2.1.tgz", + "integrity": "sha512-VObPvJiWPhpZI6C5m60XOzTfnYg/xc/an+r9VYymj9WJW3B/DIH+REzjpAACPf8brwPeP+7vz3bIim3S+AaMjw==", "dev": true, "requires": { - "kleur": "^3.0.2", - "sisteransi": "^1.0.0" + "kleur": "^3.0.3", + "sisteransi": "^1.0.3" } }, "propagate": { @@ -8545,12 +8746,12 @@ "dev": true }, "proxy-addr": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "requires": { "forwarded": "~0.1.2", - "ipaddr.js": "1.8.0" + "ipaddr.js": "1.9.0" } }, "pseudomap": { @@ -8564,9 +8765,9 @@ "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" }, "pstree.remy": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.6.tgz", - "integrity": "sha512-NdF35+QsqD7EgNEI5mkI/X+UwaxVEbQaz9f4IooEmMUv6ZPmlTQYGjBPJGgrlzNdjSvIy4MWMg6Q6vCgBO2K+w==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.7.tgz", + "integrity": "sha512-xsMgrUwRpuGskEzBFkH8NmTimbZ5PcPup0LA8JJkHIm2IMUbQcpo3yeLNWVrufEYjh8YwtSVh0xz6UeWc5Oh5A==", "dev": true }, "pump": { @@ -8600,9 +8801,9 @@ "dev": true }, "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" }, "raven": { "version": "2.6.4", @@ -8614,16 +8815,23 @@ "stack-trace": "0.0.10", "timed-out": "4.0.1", "uuid": "3.3.2" + }, + "dependencies": { + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + } } }, "raw-body": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", - "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", "requires": { - "bytes": "3.0.0", - "http-errors": "1.6.3", - "iconv-lite": "0.4.23", + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", "unpipe": "1.0.0" } }, @@ -8648,9 +8856,9 @@ } }, "react-is": { - "version": "16.8.6", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", - "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==", + "version": "16.9.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.9.0.tgz", + "integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==", "dev": true }, "read-pkg": { @@ -8720,14 +8928,13 @@ } }, "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "readdirp": { @@ -8741,12 +8948,6 @@ "readable-stream": "^2.0.2" }, "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "readable-stream": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", @@ -8864,6 +9065,7 @@ "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -8890,12 +9092,14 @@ "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, "requires": { "psl": "^1.1.24", "punycode": "^1.4.1" @@ -8940,9 +9144,9 @@ "dev": true }, "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "require-uncached": { @@ -9021,18 +9225,18 @@ "dev": true }, "rimraf": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", - "integrity": "sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=", - "optional": true, + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.0.tgz", + "integrity": "sha512-4Liqw7ccABzsWV5BzeZeGRSq7KWIgQYzOcmRDEwSX4WAawlQpcAFXZ1Kid72XYrjSnK5yxOS6Gez/iGusYE/Pw==", + "dev": true, "requires": { - "glob": "^6.0.1" + "glob": "^7.1.3" } }, "rsvp": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.4.tgz", - "integrity": "sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA==", + "version": "4.8.5", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", + "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", "dev": true }, "run-async": { @@ -9131,9 +9335,9 @@ } }, "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "requires": { "debug": "2.6.9", "depd": "~1.1.2", @@ -9142,48 +9346,37 @@ "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "~1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.4.0" + "range-parser": "~1.2.1", + "statuses": "~1.5.0" }, "dependencies": { - "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" - } - }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" - }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" } } }, "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" + "parseurl": "~1.3.3", + "send": "0.17.1" + }, + "dependencies": { + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + } } }, "set-blocking": { @@ -9193,9 +9386,9 @@ "dev": true }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -9216,9 +9409,9 @@ } }, "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" }, "shebang-command": { "version": "1.2.0", @@ -9272,9 +9465,9 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "sisteransi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.0.tgz", - "integrity": "sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.3.tgz", + "integrity": "sha512-SbEG75TzH8G7eVXFSN5f9EExILKfly7SUvVY5DhhYLvfhKqhDFY0OzevWa/zwak0RLRfWS5AvfMWpd9gJvr5Yg==", "dev": true }, "slash": { @@ -9445,9 +9638,9 @@ } }, "source-map-support": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -9506,6 +9699,7 @@ "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -9660,14 +9854,25 @@ } }, "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + } + } }, "strip-ansi": { "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.0.0" } @@ -9750,12 +9955,14 @@ "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 }, "symbol-tree": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", - "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=" + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true }, "table": { "version": "3.8.3", @@ -9829,29 +10036,19 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } } } }, "test-exclude": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.1.0.tgz", - "integrity": "sha512-gwf0S2fFsANC55fSeSqpb8BYk6w3FDvwZxfNjeF6FRgvFa43r+7wRiA/Q0IxoRU37wB/LE8IQ4221BsNucTaCA==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", + "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", "dev": true, "requires": { - "arrify": "^1.0.1", + "glob": "^7.1.3", "minimatch": "^3.0.4", "read-pkg-up": "^4.0.0", - "require-main-filename": "^1.0.1" + "require-main-filename": "^2.0.0" } }, "text-table": { @@ -9931,6 +10128,11 @@ "repeat-string": "^1.6.1" } }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, "touch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", @@ -9950,10 +10152,13 @@ } }, "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", - "optional": true + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } }, "traverse": { "version": "0.6.6", @@ -10004,6 +10209,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -10011,12 +10217,14 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true }, "type-check": { "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" } @@ -10043,9 +10251,9 @@ "dev": true }, "typescript": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", - "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", + "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", "dev": true }, "typescript-eslint-parser": { @@ -10067,23 +10275,20 @@ } }, "uglify-js": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.3.tgz", - "integrity": "sha512-rIQPT2UMDnk4jRX+w4WO84/pebU2jiLsjgIyrCktYgSvx28enOE3iYQMr+BD1rHiitWnDmpu0cY/LfIEpKcjcw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", + "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", "optional": true, "requires": { - "commander": "~2.19.0", + "commander": "~2.20.0", "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", - "optional": true - } } }, + "uid2": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", + "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=" + }, "undefsafe": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.2.tgz", @@ -10094,38 +10299,15 @@ } }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } + "set-value": "^2.0.1" } }, "uniq": { @@ -10144,9 +10326,9 @@ } }, "universal-user-agent": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-2.0.3.tgz", - "integrity": "sha512-eRHEHhChCBHrZsA4WEhdgiOKgdvgrMIHwnwnqD0r5C6AO8kwKcG7qSku3iXdhvHL3YvsS9ZkSGN8h/hIpoFC8g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-2.1.0.tgz", + "integrity": "sha512-8itiX7G05Tu3mGDTdNY2fB4KJ8MgZLS54RdG6PkkfwMAavrXu1mV/lls/GABx9O3Rw4PnTtasxrvbMQoBYY92Q==", "requires": { "os-name": "^3.0.0" } @@ -10194,12 +10376,6 @@ "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", @@ -10293,6 +10469,7 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, "requires": { "punycode": "^2.1.0" } @@ -10407,6 +10584,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -10440,10 +10618,10 @@ } }, "webidl-conversions": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-2.0.1.tgz", - "integrity": "sha1-O/glj30xjHRDw28uFpQCoaZwNQY=", - "optional": true + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true }, "whatwg-encoding": { "version": "1.0.5", @@ -10452,17 +10630,6 @@ "dev": true, "requires": { "iconv-lite": "0.4.24" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - } } }, "whatwg-mimetype": { @@ -10480,32 +10647,6 @@ "lodash.sortby": "^4.7.0", "tr46": "^1.0.1", "webidl-conversions": "^4.0.2" - }, - "dependencies": { - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - } - } - }, - "whatwg-url-compat": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/whatwg-url-compat/-/whatwg-url-compat-0.6.5.tgz", - "integrity": "sha1-AImBEa9om7CXVBzVpFymyHmERb8=", - "optional": true, - "requires": { - "tr46": "~0.0.1" } }, "which": { @@ -10542,7 +10683,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", @@ -10619,22 +10761,68 @@ } }, "x-ray": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/x-ray/-/x-ray-2.3.3.tgz", - "integrity": "sha512-7tAiDAvrK9uvGWzq/XBasMNDNCmzf1jbka0HsC88ZzfFiKb3tClL7wVzKyAJBv3h5Br4Fmcx8YQhUAcmgocfbQ==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/x-ray/-/x-ray-2.3.4.tgz", + "integrity": "sha512-QyprpnQb70ySaJ9LttmcS2R0e5d8oMiyDZ3bQ3bH/+dk5yUjt4obB9BUHz8/iGi+e7AZMxZOK60k/7x2/QiEJg==", "requires": { - "batch": "~0.5.2", + "batch": "~0.6.0", "bluebird": "^3.4.7", - "chalk": "~1.1.1", - "cheerio": "~0.20.0", - "debug": "~2.2.0", + "chalk": "~2.4.0", + "cheerio": "~0.22.0", + "debug": "~4.1.0", "enstore": "~1.0.1", "is-url": "~1.2.0", - "isobject": "~2.0.0", - "object-assign": "~4.0.1", + "isobject": "~4.0.0", + "object-assign": "~4.1.0", "stream-to-string": "^1.1.0", "x-ray-crawler": "~2.0.1", "x-ray-parse": "~1.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "x-ray-crawler": { @@ -10655,67 +10843,6 @@ "wrap-fn": "^0.1.4", "x-ray-parse": "^1.0.0", "yieldly": "0.0.1" - }, - "dependencies": { - "cheerio": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", - "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", - "requires": { - "css-select": "~1.2.0", - "dom-serializer": "~0.1.0", - "entities": "~1.1.1", - "htmlparser2": "^3.9.1", - "lodash.assignin": "^4.0.9", - "lodash.bind": "^4.1.4", - "lodash.defaults": "^4.0.1", - "lodash.filter": "^4.4.0", - "lodash.flatten": "^4.2.0", - "lodash.foreach": "^4.3.0", - "lodash.map": "^4.4.0", - "lodash.merge": "^4.4.0", - "lodash.pick": "^4.2.1", - "lodash.reduce": "^4.4.0", - "lodash.reject": "^4.4.0", - "lodash.some": "^4.4.0" - } - }, - "htmlparser2": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", - "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", - "requires": { - "domelementtype": "^1.3.1", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^3.1.1" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - }, - "readable-stream": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", - "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", - "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "x-ray-parse": { @@ -10733,10 +10860,10 @@ "dev": true }, "xml-name-validator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-2.0.1.tgz", - "integrity": "sha1-TYuPHszTQZqjYgYb7O9RXh5VljU=", - "optional": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true }, "xml2js": { "version": "0.4.19", @@ -10833,6 +10960,12 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true } } }, diff --git a/package.json b/package.json index e083b37..e1ab7ee 100644 --- a/package.json +++ b/package.json @@ -19,24 +19,30 @@ "test:watch": "jest --watch --notify --notifyMode=change --coverage" }, "dependencies": { + "@types/cookie-session": "^2.0.37", + "@types/express": "^4.17.0", + "@types/passport-github": "^1.1.5", + "cookie-session": "^1.3.3", "license-lookup": "0.0.20", - "probot": "^7.5.0", + "passport": "^0.4.0", + "passport-github": "^1.1.0", + "probot": "^7.5.3", "request-promise": "^4.2.2" }, "devDependencies": { "@types/jest": "^23.3.14", "@types/nock": "^9.3.1", - "@types/node": "^10.12.21", - "@types/request-promise": "^4.1.42", + "@types/node": "^10.14.15", + "@types/request-promise": "^4.1.44", "eslint-plugin-typescript": "^0.12.0", - "jest": "^24.5.0", + "jest": "^24.8.0", "nock": "^10.0.6", - "nodemon": "^1.18.9", + "nodemon": "^1.19.1", "nyc": "^13.3.0", "smee-client": "^1.0.2", "standard": "^10.0.3", "ts-jest": "^24.0.1", - "typescript": "^3.3.1", + "typescript": "^3.5.3", "typescript-eslint-parser": "^18.0.0" }, "engines": { diff --git a/src/auth/oauth.ts b/src/auth/oauth.ts new file mode 100644 index 0000000..c877ce0 --- /dev/null +++ b/src/auth/oauth.ts @@ -0,0 +1,52 @@ +import { Router } from "express"; + +const request = require('request') +const querystring = require('querystring') +const {promisify} = require('util') + +const post = promisify(request.post) + +export function oauth(router : Router) { + + const gh_host = process.env.GHE_HOST || "github.com"; + + router.get('/github/login', (req, res) => { + const protocol = req.headers["x-forwarded-proto"] || req.protocol + const host = req.headers['x-forwarded-host'] || req.get('host') + + const params = querystring.stringify({ + client_id: process.env.CLIENT_ID, + redirect_uri: `${protocol}://${host}/github/callback` + }) + const url = `https://${gh_host}/login/oauth/authorize?${params}` + //req.log({url}, 'Redirecting to OAuth') + res.redirect(url) + }) + + router.get('/github/callback', async (req, res) => { + + // complete OAuth dance + const tokenRes = await post({ + url: `https://${gh_host}/login/oauth/access_token`, + form: { + client_id: process.env.CLIENT_ID, + client_secret: process.env.CLIENT_SECRET, + code: req.query.code, + state: req.query.state + }, + json: true + }) + + if (tokenRes.statusCode === 200) { + if(!req.session){ + req.session = {}; + } + + req.session.token = tokenRes.body.access_token + res.redirect(req.session.redirect || '/') + } else { + res.status(500) + res.send('Invalid code') + } + }) +} \ No newline at end of file diff --git a/src/config/tasks.ts b/src/config/tasks.ts index 1cc0881..9671c7a 100644 --- a/src/config/tasks.ts +++ b/src/config/tasks.ts @@ -15,6 +15,13 @@ let TaskConfig : ITaskConfig = { enabled: true }, + risks: { + enabled: true, + tag: "risk", + tracker: "github", + url: "" + }, + specification: { enabled: true, diff --git a/src/index.ts b/src/index.ts index e5b5c3a..273b104 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,11 +2,14 @@ import { Application, Context } from "probot"; import { AppConfig, getTasksConfig } from "./config/app" import { Zincr } from "./zincr"; import { IAppParams } from "./interfaces/params/iappparams"; +import { Router, Request, Response } from "express"; +import cookieSession = require("cookie-session"); +import {oauth} from "./auth/oauth"; +import { GitHubAPI } from "probot/lib/github"; console.log(process.env); export = (app: Application) => { - const setStatusPass = require("./set-status-pass"); const events = ["pull_request", "pull_request_review"]; @@ -30,4 +33,113 @@ export = (app: Application) => { var zincr = new Zincr(params); await zincr.onChange(context); } + + // Functionality for risky UI and auth against GHE + const server : Router = app.route(); + //const client_id = process.env.CLIENT_ID; + //const client_secret = process.env.CLIENT_SECRET; + const ghe_host = process.env.GHE_HOST; + + async function authenticate (req : Request, res : Response, next : Function) { + if (!req.session || !req.session.token) { + req.session = {} + req.session.redirect = req.originalUrl + res.redirect('/github/login') + } else { + next() + } + } + + if(process.env.WEBHOOK_SECRET){ + server.use(cookieSession({ + name: 'session', + keys: [process.env.WEBHOOK_SECRET], + maxAge: 30 * 24 * 60 * 60 * 1000 // 30 days + })); + } + + oauth(server); + + server.use(async (req, res, next) => { + if(req.session){ + + if (req.session.token) { + + var gh = await app.auth() + gh.authenticate({ type: 'token', token: req.session.token }) + + if (!req.session.login) { + req.session.login = (await gh.users.getAuthenticated({})).data.login + } + + } + } + next() + }) + + server.get('/risky/:owner/:repo', authenticate, async (req, res) => { + if(req.session && ghe_host){ + + try { + + const octokit = GitHubAPI({ + baseUrl: `https://${ghe_host}/api/v3`, + logger: { + debug: () => {}, + info: () => {}, + warn: console.warn, + error: console.error + }, + }); + octokit.authenticate({ type: 'token', token: req.session.token }); + + // If this doesn't throw, they can see the repo + const gh_repo = {owner: req.params.owner, repo: req.params.repo }; + const repo = await octokit.repos.get(gh_repo); + const riskFile = await octokit.repos.getContents({ path: "risks.md", ...gh_repo }); + + //todo, parse and process the risk file + + res.render("../../../views/risky", {repo: repo.data, risks: riskFile.data}); + + } catch (err) { + // It threw an error so they can't see the repo + res.send(err); + } + + + //res.send(`Hey, you made it! - Repo: ${req.params.owner}/${req.params.repo} user:` + req.session.login); + }else{ + res.send("no session"); + } + }); + + + /* + server.get('/login', async (req, res) => { + const querystring = require('querystring'); + + //get needed values + const client_id = process.env.CLIENT_ID; + const ghe_host = process.env.GHE_HOST; + + if(!client_id || !ghe_host) + return; + + // GitHub needs us to tell it where to redirect users after they've authenticated + const protocol = req.headers['x-forwarded-proto'] || req.protocol + const host = req.headers['x-forwarded-host'] || req.get('host') + + const params = querystring.stringify({ + client_id: client_id, + redirect_uri: `${protocol}://${host}/login/cb` + }) + + const url = `https://${ghe_host}/login/oauth/authorize?${params}` + res.redirect(url) + }); + */ + + + }; diff --git a/src/interfaces/config/irisksconfig.ts b/src/interfaces/config/irisksconfig.ts new file mode 100644 index 0000000..11ece21 --- /dev/null +++ b/src/interfaces/config/irisksconfig.ts @@ -0,0 +1,6 @@ +export interface IRisksConfig { + enabled: boolean, + tag: string, + tracker: string, + url: string +} \ No newline at end of file diff --git a/src/interfaces/config/itaskconfig.ts b/src/interfaces/config/itaskconfig.ts index 13e42d7..23632b6 100644 --- a/src/interfaces/config/itaskconfig.ts +++ b/src/interfaces/config/itaskconfig.ts @@ -2,6 +2,7 @@ import { ILicenseConfig } from "./ilicenseconfig"; import { IApprovalsConfig } from "./iapprovalsconfig"; import { ISpecificationConfig } from "./ispecificationconfig"; import { ILargeCommitsConfig } from "./ilargecommitsconfig"; +import {IRisksConfig } from "./irisksconfig" export interface ITaskConfig { comment?: boolean, @@ -9,5 +10,6 @@ export interface ITaskConfig { approvals?: IApprovalsConfig, specification?: ISpecificationConfig, largecommits? : ILargeCommitsConfig, + risks? : IRisksConfig, [key: string]: any } \ No newline at end of file diff --git a/src/task-runner.ts b/src/task-runner.ts index a83d0b1..a94b3e0 100644 --- a/src/task-runner.ts +++ b/src/task-runner.ts @@ -59,12 +59,8 @@ export class TaskRunner { const runners = await this.loadRunners(); for(const runner of runners){ - try{ - await runner.run(context); + await runner.start(context); results.push(runner); - }catch(ex){ - console.log(ex); - } } const result : ITaskRunnerResults = { diff --git a/src/tasks/base.ts b/src/tasks/base.ts index 447504e..12f3100 100644 --- a/src/tasks/base.ts +++ b/src/tasks/base.ts @@ -30,6 +30,16 @@ export abstract class BaseTask implements ITask { this.organization = params.organization; } + async start(context: Context){ + + try{ + await this.run(context); + }catch(ex){ + this.result.push({ result: StatusEnum.Warning, description: ex,label: "Task failed" }); + } + + } + async run(context: Context){ return true; } diff --git a/src/tasks/risks.ts b/src/tasks/risks.ts new file mode 100644 index 0000000..267aa4c --- /dev/null +++ b/src/tasks/risks.ts @@ -0,0 +1,47 @@ +import { Context } from "probot"; +import { BaseTask } from "./base"; +import { ITaskParams } from "../interfaces/params/itaskparams"; +import { IRisksConfig } from "../interfaces/config/irisksconfig"; +import { StatusEnum } from "../interfaces/StatusEnum"; + +export default class RisksTask extends BaseTask { + + constructor(params : ITaskParams) { + super(params); + + this.name = "Risk Assessment"; + this.description = "Guides developers to assess the risk of their application by checking the change data and validity of risks.md"; + this.resolution = `Please ensure you have a risks.md file and it is updated regularly`; + this.postAsComment = true; + } + + + async run(context: Context){ + + const riskfile = await context.github.repos.getContents( { ...this.repo, path: "risks.md" } ); + if(riskfile.status !== 200) + { + + this.result.push({ + label: "No risks.md file found", + result: StatusEnum.Failure, + description: `Create a risks.md file - [Click here](https://${context.host}/risky/${this.repo.owner}/${this.repo.repo}/)` + }) + + }else{ + + this.result.push({ + label: "Update your Risks.md file", + result: StatusEnum.Failure, + description: `Update your risk assessment - [Click here](https://${context.host}/risky/${this.repo.owner}/${this.repo.repo}/)` + }) + + } + + return true; + } +} + + + + diff --git a/test/zincr.test.ts b/test/zincr.test.ts index a70b387..8436d3d 100644 --- a/test/zincr.test.ts +++ b/test/zincr.test.ts @@ -64,7 +64,7 @@ describe("zincr", () => { }; var zincr = new Zincr(params); - expect(zincr.runner.tasks.length).toBe(4); + expect(zincr.runner.tasks.length).toBe(5); expect(zincr.appconfig).toMatchObject(AppConfig); expect(zincr.taskconfig).toMatchObject(TaskConfig); done(); @@ -84,7 +84,7 @@ describe("zincr", () => { var zincr = new Zincr(params); - expect(zincr.runner.tasks.length).toBe(4); + expect(zincr.runner.tasks.length).toBe(5); const runners = await zincr.runner.loadRunners(); expect(runners.every(x => x.organization === "zalando")); expect(runners.every(x => x.repo.repo === "rest")); diff --git a/views/risky.hbs b/views/risky.hbs new file mode 100644 index 0000000..68ab02a --- /dev/null +++ b/views/risky.hbs @@ -0,0 +1,223 @@ + + + + + + + + Setup {{#if pkg.name }}{{ pkg.name }}{{else}}Your App{{/if}} | built with Probot + + + + + +
+ +

Rapid Risk Assessment for /{{repo.full_name}}

+ +
+
+ + Rapid risk assessment (RRA) is a lightweight decision-making process which + delivery teams can easily adopt into their sprints to address + potential security issues early and often. A typical RRA will take 20-30 + mins to complete and the outcome is an actionable list of tasks which are + easy to communicate and prioritise for the team. + Rapid Risk Documentation + +
+ + + +
+
+ Risk Score +

HIGH

+
+ +
+ Data Sources +

4

+
+ +
+ Data Classification +

RED

+
+ +
+ Open Risks +

3

+
+
+ + +
+ + +

1. Register data processed by {{repo.name}}

+

Register and classify all data processed by this service

+ + Customer Data + Employee Data + Stock Data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Data Type + + Approximate # of records + + Notes +
+ + Customer Profiles + + +100.000 RecordsUsed by the customer profile form
+ + Customer Shopping History + + <100 RecordsUsed in the recommendation widget
+ + Article meta data + + +100.000 RecordsUsed in article display
+ + Creditcard data + + +100.000 RecordsUsed in article display
+
+ +
+ +

2. Outline attack scenarios

+

Discuss potential attack scenarios, to figure out what the worst case + scenarios could be. Keep these notes +

+ + + +
+ +

3. Validate And Prioritise

+

Based on your outlined scenarios above, evaluate what each scenario could + lead to, what is the outcome, and what is the impact of the scenario. + Documentation on how to validate and prioritise using the bowtie model +

+ +

+ After validating and priortising your scenarios, log them in your issue + tracker tagged with the tag risk +

+ + Open Issue Tracker + +
+ +
Current Issues
+

All risk-related issues logged by the team in the {{repo.name}} issue tracker tagged as + risk +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Task + + Priority + + State + + Created +
Enforce 2FA on admin dashboard loginHighIn progress16 days ago
Create daily digests to monitor usageLowFixed20 days ago
Implement CSP on the admin UI to mitigate XSS riskLowIn progress6 days ago
Review access to logging service and data storedMediumIn progress16 days ago
+ + +
+ + +
+
+ +
+

Need help?

+ + +
+ + + + \ No newline at end of file From 4eb3bd15f58b7aee3bd35e7f8013d41f5408b10e Mon Sep 17 00:00:00 2001 From: Per Ploug Date: Thu, 15 Aug 2019 13:22:41 +0200 Subject: [PATCH 2/7] Bump version, disable sonarqube Signed-off-by: Per Ploug --- delivery.yaml | 2 -- package.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/delivery.yaml b/delivery.yaml index ab27cc2..f729070 100644 --- a/delivery.yaml +++ b/delivery.yaml @@ -15,8 +15,6 @@ build_steps: npm install --no-optional npm run test - sonar-client --recipes=master-dashboard,pr-issues-as-comments - - desc: Build cmd: | function npm { diff --git a/package.json b/package.json index e1ab7ee..3c52233 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zincr", - "version": "1.0.4", + "version": "1.0.5", "description": "Compliance Bot for Zalando", "author": "Per Ploug ", "license": "MIT", From 7e75decb090225434f57d67a1c07b8e6b88b6a94 Mon Sep 17 00:00:00 2001 From: Per Ploug Date: Thu, 15 Aug 2019 16:43:02 +0200 Subject: [PATCH 3/7] update of copy Signed-off-by: Per Ploug --- src/tasks/risks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/risks.ts b/src/tasks/risks.ts index 267aa4c..edc67fb 100644 --- a/src/tasks/risks.ts +++ b/src/tasks/risks.ts @@ -33,7 +33,7 @@ export default class RisksTask extends BaseTask { this.result.push({ label: "Update your Risks.md file", result: StatusEnum.Failure, - description: `Update your risk assessment - [Click here](https://${context.host}/risky/${this.repo.owner}/${this.repo.repo}/)` + description: ` [Update your risk assessment](https://${context.host}/risky/${this.repo.owner}/${this.repo.repo}/)` }) } From 26f867809daf898b381c8c27f2abf9e2f090563c Mon Sep 17 00:00:00 2001 From: Per Ploug Date: Thu, 15 Aug 2019 17:16:09 +0200 Subject: [PATCH 4/7] Update risks.ts Signed-off-by: Per Ploug --- src/tasks/risks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/risks.ts b/src/tasks/risks.ts index edc67fb..2bb89f8 100644 --- a/src/tasks/risks.ts +++ b/src/tasks/risks.ts @@ -31,7 +31,7 @@ export default class RisksTask extends BaseTask { }else{ this.result.push({ - label: "Update your Risks.md file", + label: "Please update your Risks.md file", result: StatusEnum.Failure, description: ` [Update your risk assessment](https://${context.host}/risky/${this.repo.owner}/${this.repo.repo}/)` }) From 99f59d20c748d55f05755d2696bcbf8cc5197baf Mon Sep 17 00:00:00 2001 From: Per Ploug Date: Fri, 13 Sep 2019 23:50:07 +0200 Subject: [PATCH 5/7] ongoing WIP on risk poc Signed-off-by: Per Ploug --- lib/app/assessment.d.ts | 4 + lib/app/assessment.js | 245 ++++++++++++++++ lib/app/assessment.js.map | 1 + lib/app/issues.d.ts | 3 + lib/app/issues.js | 116 ++++++++ lib/app/issues.js.map | 1 + lib/app/oauth.d.ts | 3 + lib/app/oauth.js | 105 +++++++ lib/app/oauth.js.map | 1 + lib/app/octokit.d.ts | 2 + lib/app/octokit.js | 18 ++ lib/app/octokit.js.map | 1 + lib/app/pullrequest.d.ts | 2 + lib/app/pullrequest.js | 68 +++++ lib/app/pullrequest.js.map | 1 + lib/index.js | 157 ++--------- lib/index.js.map | 2 +- lib/tasks/risks.js | 6 +- lib/tasks/risks.js.map | 2 +- package-lock.json | 162 +++++------ package.json | 17 +- public/components.js | 188 +++++++++++++ public/data.js | 372 +++++++++++++++++++++++++ public/risk.js | 251 +++++++++++++++++ src/app/assessment.ts | 140 ++++++++++ src/app/issues.ts | 50 ++++ src/{auth => app}/oauth.ts | 17 +- src/app/octokit.ts | 16 ++ src/app/pullrequest.ts | 20 ++ src/index.ts | 144 +++------- src/tasks/risks.ts | 5 +- views/risky.hbs | 554 ++++++++++++++++++++++++++----------- 32 files changed, 2162 insertions(+), 512 deletions(-) create mode 100644 lib/app/assessment.d.ts create mode 100644 lib/app/assessment.js create mode 100644 lib/app/assessment.js.map create mode 100644 lib/app/issues.d.ts create mode 100644 lib/app/issues.js create mode 100644 lib/app/issues.js.map create mode 100644 lib/app/oauth.d.ts create mode 100644 lib/app/oauth.js create mode 100644 lib/app/oauth.js.map create mode 100644 lib/app/octokit.d.ts create mode 100644 lib/app/octokit.js create mode 100644 lib/app/octokit.js.map create mode 100644 lib/app/pullrequest.d.ts create mode 100644 lib/app/pullrequest.js create mode 100644 lib/app/pullrequest.js.map create mode 100644 public/components.js create mode 100644 public/data.js create mode 100644 public/risk.js create mode 100644 src/app/assessment.ts create mode 100644 src/app/issues.ts rename src/{auth => app}/oauth.ts (81%) create mode 100644 src/app/octokit.ts create mode 100644 src/app/pullrequest.ts diff --git a/lib/app/assessment.d.ts b/lib/app/assessment.d.ts new file mode 100644 index 0000000..0c4ef6d --- /dev/null +++ b/lib/app/assessment.d.ts @@ -0,0 +1,4 @@ +import { Request, Response } from "express"; +export declare function postAssessment(req: Request, res: Response): Promise; +export declare function getAssessment(req: Request, res: Response): Promise; +export declare function getUi(req: Request, res: Response): Promise; diff --git a/lib/app/assessment.js b/lib/app/assessment.js new file mode 100644 index 0000000..0823ee0 --- /dev/null +++ b/lib/app/assessment.js @@ -0,0 +1,245 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var octokit_1 = require("./octokit"); +//@ts-ignore +var YAML = require("json-to-pretty-yaml"); +//@ts-ignore +var yamltojs = require("js-yaml"); +var ghe_host = process.env.GHE_HOST; +var rr_branch = "rapid-risk"; +//const master_branch = "master"; +var rr_file = "risks.md"; +function getRiskFile(octokit, repo, branch) { + if (branch === void 0) { branch = ''; } + return __awaiter(this, void 0, void 0, function () { + var req, response, ex_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + req = __assign({ path: rr_file }, repo); + if (branch !== '') { + //@ts-ignore + req.ref = branch; + } + return [4 /*yield*/, octokit.repos.getContents(req)]; + case 1: + response = _a.sent(); + if (response.status === 200) { + return [2 /*return*/, response.data]; + } + return [3 /*break*/, 3]; + case 2: + ex_1 = _a.sent(); + console.log(ex_1); + return [2 /*return*/, null]; + case 3: return [2 /*return*/]; + } + }); + }); +} +; +function updateRiskFile(content, sha, octokit, repo, branch) { + return __awaiter(this, void 0, void 0, function () { + var yaml, ex_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + yaml = Buffer.from(YAML.stringify(content)).toString('base64'); + return [4 /*yield*/, octokit.repos.updateFile(__assign({}, repo, { path: rr_file, sha: sha, content: yaml, message: "updated risk file", branch: branch }))]; + case 1: + _a.sent(); + return [2 /*return*/, true]; + case 2: + ex_2 = _a.sent(); + return [2 /*return*/, false]; + case 3: return [2 /*return*/]; + } + }); + }); +} +; +function postAssessment(req, res) { + return __awaiter(this, void 0, void 0, function () { + var octokit, gh_repo, branched_riskFile, result, err_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(req.session && ghe_host)) return [3 /*break*/, 7]; + _a.label = 1; + case 1: + _a.trys.push([1, 5, , 6]); + octokit = octokit_1.getOctokit(ghe_host, req.session.token); + gh_repo = { owner: req.params.owner, repo: req.params.repo }; + return [4 /*yield*/, getRiskFile(octokit, gh_repo, rr_branch)]; + case 2: + branched_riskFile = _a.sent(); + if (!branched_riskFile) return [3 /*break*/, 4]; + return [4 /*yield*/, updateRiskFile(req.body, branched_riskFile.sha, octokit, gh_repo, rr_branch)]; + case 3: + result = _a.sent(); + if (!result) { + res.status(500); + } + return [3 /*break*/, 4]; + case 4: + // ensure PR is open + // update descripting with stats + /* if branch already exists + if(prs.data.length > 0){ + const riskFile = await octokit.repos.getContents({ path: "risks.md", ...gh_repo, ref: rr_branch }); + const sha = riskFile.data.sha; + const content = Buffer.from(YAML.stringify(req.body)).toString('base64'); + await octokit.repos.updateFile({...gh_repo, path: "risks.md", sha: sha, content: content, message: "updated risk file", branch: "rapid-risk"}); + }else{ + + }*/ + //update the file + res.sendStatus(200); + return [3 /*break*/, 6]; + case 5: + err_1 = _a.sent(); + // It threw an error so they can't see the repo + res.send(err_1); + return [3 /*break*/, 6]; + case 6: return [3 /*break*/, 8]; + case 7: + res.send("no session"); + _a.label = 8; + case 8: return [2 /*return*/]; + } + }); + }); +} +exports.postAssessment = postAssessment; +; +function getAssessment(req, res) { + return __awaiter(this, void 0, void 0, function () { + var octokit, gh_repo, riskFile, content, ex_3, err_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(req.session && ghe_host)) return [3 /*break*/, 10]; + _a.label = 1; + case 1: + _a.trys.push([1, 8, , 9]); + octokit = octokit_1.getOctokit(ghe_host, req.session.token); + gh_repo = { owner: req.params.owner, repo: req.params.repo }; + _a.label = 2; + case 2: + _a.trys.push([2, 6, , 7]); + return [4 /*yield*/, getRiskFile(octokit, gh_repo, rr_branch)]; + case 3: + riskFile = _a.sent(); + if (!!riskFile) return [3 /*break*/, 5]; + return [4 /*yield*/, getRiskFile(octokit, gh_repo)]; + case 4: + riskFile = _a.sent(); + _a.label = 5; + case 5: + if (!riskFile) { + riskFile = {}; + } + content = yamltojs.safeLoad(new Buffer(riskFile.content, 'base64').toString('ascii')); + res.status(200).send(content); + return [3 /*break*/, 7]; + case 6: + ex_3 = _a.sent(); + res.status(500).send(ex_3); + return [3 /*break*/, 7]; + case 7: return [3 /*break*/, 9]; + case 8: + err_2 = _a.sent(); + // It threw an error so they can't see the repo + res.status(500).send(err_2); + return [3 /*break*/, 9]; + case 9: return [3 /*break*/, 11]; + case 10: + res.send("no session"); + _a.label = 11; + case 11: return [2 /*return*/]; + } + }); + }); +} +exports.getAssessment = getAssessment; +; +function getUi(req, res) { + return __awaiter(this, void 0, void 0, function () { + var octokit, gh_repo, repo, ex_4; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(req.session && ghe_host)) return [3 /*break*/, 5]; + octokit = octokit_1.getOctokit(ghe_host, req.session.token); + gh_repo = { owner: req.params.owner, repo: req.params.repo }; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, octokit.repos.get(__assign({}, gh_repo))]; + case 2: + repo = _a.sent(); + res.render("../../../views/risky.hbs", { repo: repo.data }); + return [3 /*break*/, 4]; + case 3: + ex_4 = _a.sent(); + res.status(500).send(ex_4); + return [3 /*break*/, 4]; + case 4: return [3 /*break*/, 6]; + case 5: + res.send("no session"); + _a.label = 6; + case 6: return [2 /*return*/]; + } + }); + }); +} +exports.getUi = getUi; +//# sourceMappingURL=assessment.js.map \ No newline at end of file diff --git a/lib/app/assessment.js.map b/lib/app/assessment.js.map new file mode 100644 index 0000000..f7f0132 --- /dev/null +++ b/lib/app/assessment.js.map @@ -0,0 +1 @@ +{"version":3,"file":"assessment.js","sourceRoot":"","sources":["../../src/app/assessment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAuC;AAEvC,YAAY;AACZ,0CAA6C;AAE7C,YAAY;AACZ,kCAAqC;AAGrC,IAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AACtC,IAAM,SAAS,GAAG,YAAY,CAAC;AAC/B,iCAAiC;AACjC,IAAM,OAAO,GAAG,UAAU,CAAC;AAE3B,SAAe,WAAW,CAAC,OAAmB,EAAE,IAAoC,EAAE,MAAoB;IAApB,uBAAA,EAAA,WAAoB;;;;;;;oBAElG,GAAG,cAAK,IAAI,EAAE,OAAO,IAAK,IAAI,CAAE,CAAC;oBACrC,IAAG,MAAM,KAAK,EAAE,EAAC;wBACf,YAAY;wBACZ,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC;qBAClB;oBAGc,qBAAM,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG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@ -0,0 +1,3 @@ +import { Request, Response } from "express"; +export declare function getIssues(req: Request, res: Response): Promise; +export declare function postIssue(req: Request, res: Response): Promise; diff --git a/lib/app/issues.js b/lib/app/issues.js new file mode 100644 index 0000000..fbdc3a8 --- /dev/null +++ b/lib/app/issues.js @@ -0,0 +1,116 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var octokit_1 = require("./octokit"); +var ghe_host = process.env.GHE_HOST; +function getIssues(req, res) { + return __awaiter(this, void 0, void 0, function () { + var octokit, gh_repo, issues, ex_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(req.session && ghe_host)) return [3 /*break*/, 5]; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + octokit = octokit_1.getOctokit(ghe_host, req.session.token); + gh_repo = { owner: req.params.owner, repo: req.params.repo }; + return [4 /*yield*/, octokit.issues.listForRepo(__assign({}, gh_repo, { labels: 'risk' }))]; + case 2: + issues = _a.sent(); + ; + res.send(issues.data); + return [3 /*break*/, 4]; + case 3: + ex_1 = _a.sent(); + res.status(500).send(ex_1); + return [3 /*break*/, 4]; + case 4: return [3 /*break*/, 6]; + case 5: + res.send("no session"); + _a.label = 6; + case 6: return [2 /*return*/]; + } + }); + }); +} +exports.getIssues = getIssues; +; +function postIssue(req, res) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (req.session && ghe_host) { + //var octokit = getOctokit(ghe_host, req.session.token); + /* + var ev = req.body; + //ev.datasource + //ev.threats.label + + // how do we construct a fairly generic body here to convey info of threats -> event -> consequeces + var body = { + title: + } + + const gh_repo = {owner: req.params.owner, repo: req.params.repo }; + const issues = await octokit.issues.create({...gh_repo, title}) .listForRepo({...gh_repo, labels: 'risk'});; + res.send(issues.data); + + }catch(ex){ + res.status(500).send(ex); + } + }else{ + res.send("no session"); + }*/ + } + return [2 /*return*/]; + }); + }); +} +exports.postIssue = postIssue; +; +//# sourceMappingURL=issues.js.map \ No newline at end of file diff --git a/lib/app/issues.js.map b/lib/app/issues.js.map new file mode 100644 index 0000000..ebe0a91 --- /dev/null +++ b/lib/app/issues.js.map @@ -0,0 +1 @@ +{"version":3,"file":"issues.js","sourceRoot":"","sources":["../../src/app/issues.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAuC;AAGvC,IAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AAEtC,SAAsB,SAAS,CAAC,GAAa,EAAE,GAAa;;;;;;yBACvD,CAAA,GAAG,CAAC,OAAO,IAAI,QAAQ,CAAA,EAAvB,wBAAuB;;;;oBAGlB,OAAO,GAAG,oBAAU,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBAChD,OAAO,GAAG,EAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;oBACnD,qBAAM,OAAO,CAAC,MAAM,CAAC,WAAW,cAAK,OAAO,IAAE,MAAM,EAAE,MAAM,IAAE,EAAA;;oBAAvE,MAAM,GAAG,SAA8D;oBAAC,CAAC;oBAC/E,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;;;oBAGtB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAE,CAAC,CAAC;;;;oBAG3B,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;;;;;;CAE1B;AAfD,8BAeC;AAAA,CAAC;AAEF,SAAsB,SAAS,CAAC,GAAa,EAAE,GAAa;;;YAC1D,IAAG,GAAG,CAAC,OAAO,IAAI,QAAQ,EAAC;gBAGtB,wDAAwD;gBACxD;;;;;;;;;;;;;;;;;;;eAmBD;aAEJ;;;;CACD;AA3BD,8BA2BC;AAAA,CAAC"} \ No newline at end of file diff --git a/lib/app/oauth.d.ts b/lib/app/oauth.d.ts new file mode 100644 index 0000000..0f0af93 --- /dev/null +++ b/lib/app/oauth.d.ts @@ -0,0 +1,3 @@ +import { Router, Request, Response } from "express"; +export declare function oauth(router: Router): void; +export declare function authenticate(req: Request, res: Response, next: Function): Promise; diff --git a/lib/app/oauth.js b/lib/app/oauth.js new file mode 100644 index 0000000..a6f3df5 --- /dev/null +++ b/lib/app/oauth.js @@ -0,0 +1,105 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var request = require('request'); +var querystring = require('querystring'); +var promisify = require('util').promisify; +var post = promisify(request.post); +function oauth(router) { + var _this = this; + var gh_host = process.env.GHE_HOST || "github.com"; + router.get('/github/login', function (req, res) { + var protocol = req.headers["x-forwarded-proto"] || req.protocol; + var host = req.headers['x-forwarded-host'] || req.get('host'); + var params = querystring.stringify({ + client_id: process.env.CLIENT_ID, + redirect_uri: protocol + "://" + host + "/github/callback" + }); + var url = "https://" + gh_host + "/login/oauth/authorize?" + params; + //req.log({url}, 'Redirecting to OAuth') + res.redirect(url); + }); + router.get('/github/callback', function (req, res) { return __awaiter(_this, void 0, void 0, function () { + var tokenRes; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, post({ + url: "https://" + gh_host + "/login/oauth/access_token", + form: { + client_id: process.env.CLIENT_ID, + client_secret: process.env.CLIENT_SECRET, + code: req.query.code, + state: req.query.state + }, + json: true + })]; + case 1: + tokenRes = _a.sent(); + if (tokenRes.statusCode === 200) { + if (!req.session) { + req.session = {}; + } + req.session.token = tokenRes.body.access_token; + res.redirect(req.session.redirect || '/'); + } + else { + res.status(500); + res.send('Invalid code'); + } + return [2 /*return*/]; + } + }); + }); }); +} +exports.oauth = oauth; +function authenticate(req, res, next) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (!req.session || !req.session.token) { + req.session = {}; + req.session.redirect = req.originalUrl; + res.redirect('/github/login'); + } + else { + next(); + } + return [2 /*return*/]; + }); + }); +} +exports.authenticate = authenticate; +//# sourceMappingURL=oauth.js.map \ No newline at end of file diff --git a/lib/app/oauth.js.map b/lib/app/oauth.js.map new file mode 100644 index 0000000..f7af199 --- /dev/null +++ b/lib/app/oauth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../src/app/oauth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAClC,IAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AACnC,IAAA,qCAAS,CAAmB;AACnC,IAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAGpC,SAAgB,KAAK,CAAC,MAAe;IAArC,iBA2CC;IAzCC,IAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,YAAY,CAAC;IAErD,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,UAAC,GAAG,EAAE,GAAG;QACnC,IAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAA;QACjE,IAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAE/D,IAAM,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC;YACnC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS;YAChC,YAAY,EAAK,QAAQ,WAAM,IAAI,qBAAkB;SACtD,CAAC,CAAA;QACF,IAAM,GAAG,GAAG,aAAW,OAAO,+BAA0B,MAAQ,CAAA;QAChE,wCAAwC;QACxC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IACnB,CAAC,CAAC,CAAA;IAEF,MAAM,CAAC,GAAG,CA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;;;CACF;AARD,oCAQC"} \ No newline at end of file diff --git a/lib/app/octokit.d.ts b/lib/app/octokit.d.ts new file mode 100644 index 0000000..9a7d924 --- /dev/null +++ b/lib/app/octokit.d.ts @@ -0,0 +1,2 @@ +import { GitHubAPI } from "probot/lib/github"; +export declare function getOctokit(host: string, token: string): GitHubAPI; diff --git a/lib/app/octokit.js b/lib/app/octokit.js new file mode 100644 index 0000000..c5fe1d1 --- /dev/null +++ b/lib/app/octokit.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var github_1 = require("probot/lib/github"); +function getOctokit(host, token) { + var octokit = github_1.GitHubAPI({ + baseUrl: "https://" + host + "/api/v3", + logger: { + debug: function () { }, + info: function () { }, + warn: console.warn, + error: console.error + }, + }); + octokit.authenticate({ type: 'token', token: token }); + return octokit; +} +exports.getOctokit = getOctokit; +//# sourceMappingURL=octokit.js.map \ No newline at end of file diff --git a/lib/app/octokit.js.map b/lib/app/octokit.js.map new file mode 100644 index 0000000..c43a095 --- /dev/null +++ b/lib/app/octokit.js.map @@ -0,0 +1 @@ +{"version":3,"file":"octokit.js","sourceRoot":"","sources":["../../src/app/octokit.ts"],"names":[],"mappings":";;AAAA,4CAA8C;AAE9C,SAAgB,UAAU,CAAC,IAAa,EAAE,KAAc;IACtD,IAAM,OAAO,GAAG,kBAAS,CAAC;QACxB,OAAO,EAAE,aAAW,IAAI,YAAS;QACjC,MAAM,EAAE;YACN,KAAK,EAAE,cAAO,CAAC;YACf,IAAI,EAAE,cAAO,CAAC;YACd,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB;KACF,CAAC,CAAC;IAEH,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC;AACjB,CAAC;AAbD,gCAaC"} \ No newline at end of file diff --git a/lib/app/pullrequest.d.ts b/lib/app/pullrequest.d.ts new file mode 100644 index 0000000..cf67754 --- /dev/null +++ b/lib/app/pullrequest.d.ts @@ -0,0 +1,2 @@ +import { Context } from "probot"; +export declare function processPullRequest(context: Context): Promise; diff --git a/lib/app/pullrequest.js b/lib/app/pullrequest.js new file mode 100644 index 0000000..210b794 --- /dev/null +++ b/lib/app/pullrequest.js @@ -0,0 +1,68 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var app_1 = require("../config/app"); +var zincr_1 = require("../zincr"); +function processPullRequest(context) { + return __awaiter(this, void 0, void 0, function () { + var params, _a, zincr; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = { + repo: context.repo(), + organization: null + }; + return [4 /*yield*/, app_1.getTasksConfig(context)]; + case 1: + params = (_a.taskconfig = _b.sent(), + _a.appconfig = app_1.AppConfig, + _a); + if (context.payload.repository.organization && context.payload.repository.organization.login) { + params.organization = context.payload.repository.organization.login; + } + zincr = new zincr_1.Zincr(params); + return [4 /*yield*/, zincr.onChange(context)]; + case 2: + _b.sent(); + return [2 /*return*/]; + } + }); + }); +} +exports.processPullRequest = processPullRequest; +//# sourceMappingURL=pullrequest.js.map \ No newline at end of file diff --git a/lib/app/pullrequest.js.map b/lib/app/pullrequest.js.map new file mode 100644 index 0000000..d4d6706 --- /dev/null +++ b/lib/app/pullrequest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pullrequest.js","sourceRoot":"","sources":["../../src/app/pullrequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAA0D;AAC1D,kCAAiC;AAGjC,SAAsB,kBAAkB,CAAC,OAAiB;;;;;;;wBAEtD,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE;wBACpB,YAAY,EAAE,IAAI;;oBACN,qBAAM,oBAAc,CAAC,OAAO,CAAC,EAAA;;oBAHrC,MAAM,IAGV,aAAU,GAAE,SAA6B;wBACzC,YAAS,GAAE,eAAS;2BACrB;oBAED,IAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,EAAC;wBAC1F,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC;qBACrE;oBAEG,KAAK,GAAG,IAAI,aAAK,CAAC,MAAM,CAAC,CAAC;oBAC9B,qBAAM,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAA;;oBAA7B,SAA6B,CAAC;;;;;CAC/B;AAdD,gDAcC"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index 7f89dca..0069dca 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,15 +1,4 @@ "use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -46,65 +35,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) { } }; var _this = this; -var app_1 = require("./config/app"); -var zincr_1 = require("./zincr"); var cookieSession = require("cookie-session"); -var oauth_1 = require("./auth/oauth"); -var github_1 = require("probot/lib/github"); -console.log(process.env); +var express = require("express"); +var path = require("path"); +var bodyParser = require("body-parser"); +var oauth_1 = require("./app/oauth"); +// controllers +var assessment_1 = require("./app/assessment"); +var issues_1 = require("./app/issues"); +var pullrequest_1 = require("./app/pullrequest"); module.exports = function (app) { - var setStatusPass = require("./set-status-pass"); - var events = ["pull_request", "pull_request_review"]; // Runs the check on all pull request and review events - app.on(events, processPullRequest); - app.on('check_run.requested_action', setStatusPass); - function processPullRequest(context) { - return __awaiter(this, void 0, void 0, function () { - var params, _a, zincr; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = { - repo: context.repo(), - organization: null - }; - return [4 /*yield*/, app_1.getTasksConfig(context)]; - case 1: - params = (_a.taskconfig = _b.sent(), - _a.appconfig = app_1.AppConfig, - _a); - if (context.payload.repository.organization && context.payload.repository.organization.login) { - params.organization = context.payload.repository.organization.login; - } - zincr = new zincr_1.Zincr(params); - return [4 /*yield*/, zincr.onChange(context)]; - case 2: - _b.sent(); - return [2 /*return*/]; - } - }); - }); - } - // Functionality for risky UI and auth against GHE + var events = ["pull_request", "pull_request_review"]; + app.on(events, pullrequest_1.processPullRequest); + // Router for authenticating against github enterprise var server = app.route(); - //const client_id = process.env.CLIENT_ID; - //const client_secret = process.env.CLIENT_SECRET; - var ghe_host = process.env.GHE_HOST; - function authenticate(req, res, next) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!req.session || !req.session.token) { - req.session = {}; - req.session.redirect = req.originalUrl; - res.redirect('/github/login'); - } - else { - next(); - } - return [2 /*return*/]; - }); - }); - } + // authentication configuration for github oauth if (process.env.WEBHOOK_SECRET) { server.use(cookieSession({ name: 'session', @@ -112,7 +58,9 @@ module.exports = function (app) { maxAge: 30 * 24 * 60 * 60 * 1000 // 30 days })); } + //setup routes for oauth oauth_1.oauth(server); + // middleware to enforce redirect on missing auth server.use(function (req, res, next) { return __awaiter(_this, void 0, void 0, function () { var gh, _a; return __generator(this, function (_b) { @@ -136,71 +84,16 @@ module.exports = function (app) { } }); }); }); - server.get('/risky/:owner/:repo', authenticate, function (req, res) { return __awaiter(_this, void 0, void 0, function () { - var octokit, gh_repo, repo, riskFile, err_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(req.session && ghe_host)) return [3 /*break*/, 6]; - _a.label = 1; - case 1: - _a.trys.push([1, 4, , 5]); - octokit = github_1.GitHubAPI({ - baseUrl: "https://" + ghe_host + "/api/v3", - logger: { - debug: function () { }, - info: function () { }, - warn: console.warn, - error: console.error - }, - }); - octokit.authenticate({ type: 'token', token: req.session.token }); - gh_repo = { owner: req.params.owner, repo: req.params.repo }; - return [4 /*yield*/, octokit.repos.get(gh_repo)]; - case 2: - repo = _a.sent(); - return [4 /*yield*/, octokit.repos.getContents(__assign({ path: "risks.md" }, gh_repo))]; - case 3: - riskFile = _a.sent(); - //todo, parse and process the risk file - res.render("../../../views/risky", { repo: repo.data, risks: riskFile.data }); - return [3 /*break*/, 5]; - case 4: - err_1 = _a.sent(); - // It threw an error so they can't see the repo - res.send(err_1); - return [3 /*break*/, 5]; - case 5: return [3 /*break*/, 7]; - case 6: - res.send("no session"); - _a.label = 7; - case 7: return [2 /*return*/]; - } - }); - }); }); - /* - server.get('/login', async (req, res) => { - const querystring = require('querystring'); - - //get needed values - const client_id = process.env.CLIENT_ID; - const ghe_host = process.env.GHE_HOST; - - if(!client_id || !ghe_host) - return; - - // GitHub needs us to tell it where to redirect users after they've authenticated - const protocol = req.headers['x-forwarded-proto'] || req.protocol - const host = req.headers['x-forwarded-host'] || req.get('host') - - const params = querystring.stringify({ - client_id: client_id, - redirect_uri: `${protocol}://${host}/login/cb` - }) - - const url = `https://${ghe_host}/login/oauth/authorize?${params}` - res.redirect(url) - }); - */ + // Functionality for risk UI + var zincr_app = app.route("/zincr"); + zincr_app.use(bodyParser.json()); + zincr_app.use('/libs', express.static(path.join(__dirname, '../node_modules'))); + zincr_app.use("/public", express.static(path.join(__dirname, '../public'))); + // routes + zincr_app.post('/risk/:owner/:repo/issue', oauth_1.authenticate, issues_1.postIssue); + zincr_app.get('/risk/:owner/:repo/issues', oauth_1.authenticate, issues_1.getIssues); + zincr_app.post('/risk/:owner/:repo/assessment', oauth_1.authenticate, assessment_1.postAssessment); + zincr_app.get('/risk/:owner/:repo/assessment', oauth_1.authenticate, assessment_1.getAssessment); + zincr_app.get('/risk/:owner/:repo', oauth_1.authenticate, assessment_1.getUi); }; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map index 761ecec..9ac193f 100644 --- a/lib/index.js.map +++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C;IAC5E,SAAS,CAAC,GAAG,CAAC,oBAAoB,EAAE,oBAAY,EAAE,kBAAK,CAAC,CAAC;AAC3D,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/tasks/risks.js b/lib/tasks/risks.js index 4e33c0d..2a5ecb7 100644 --- a/lib/tasks/risks.js +++ b/lib/tasks/risks.js @@ -82,14 +82,14 @@ var RisksTask = /** @class */ (function (_super) { this.result.push({ label: "No risks.md file found", result: "failure" /* Failure */, - description: "Create a risks.md file - [Click here](https://" + context.host + "/risky/" + this.repo.owner + "/" + this.repo.repo + "/)" + description: "Create a risks.md file - [Click here](https://" + context.host + "/zincr/risk/" + this.repo.owner + "/" + this.repo.repo + "/)" }); } else { this.result.push({ - label: "Update your Risks.md file", + label: "Please update your Risks.md file", result: "failure" /* Failure */, - description: "Update your risk assessment - [Click here](https://" + context.host + "/risky/" + this.repo.owner + "/" + this.repo.repo + "/)" + description: " [Update your risk assessment](https://" + context.host + "/zincr/risk/" + this.repo.owner + "/" + this.repo.repo + "/)" }); } return [2 /*return*/, true]; diff --git a/lib/tasks/risks.js.map b/lib/tasks/risks.js.map index 31b8523..d8ea9fb 100644 --- a/lib/tasks/risks.js.map +++ b/lib/tasks/risks.js.map @@ -1 +1 @@ -{"version":3,"file":"risks.js","sourceRoot":"","sources":["../../src/tasks/risks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAkC;AAKlC;IAAuC,6BAAsB;IAE3D,mBAAY,MAAkC;QAA9C,YACE,kBAAM,MAAM,CAAC,SAMd;QAJC,KAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,KAAI,CAAC,WAAW,GAAI,gHAAgH,CAAC;QACrI,KAAI,CAAC,UAAU,GAAG,oEAAoE,CAAC;QACvF,KAAI,CAAC,aAAa,GAAG,IAAI,CAAC;;IAC5B,CAAC;IAGK,uBAAG,GAAT,UAAU,OAAgB;;;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AG,GAAT,UAAU,OAAgB;;;;;4BAGP,qBAAM,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,cAAO,IAAI,CAAC,IAAI,IAAE,IAAI,EAAE,UAAU,IAAI,EAAA;;wBAAvF,QAAQ,GAAG,SAA4E;wBAC7F,IAAG,QAAQ,CAAC,MAAM,KAAK,GAAG,EAC1B;4BAEE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gCACf,KAAK,EAAE,wBAAwB;gCAC/B,MAAM,yBAAoB;gCAC1B,WAAW,EAAE,mDAAiD,OAAO,CAAC,IAAI,oBAAe,IAAI,CAAC,IAAI,CAAC,KAAK,SAAI,IAAI,CAAC,IAAI,CAAC,IAAI,OAAI;6BAC/H,CAAC,CAAA;yBAEH;6BAAI;4BAEH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gCACf,KAAK,EAAE,kCAAkC;gCACzC,MAAM,yBAAoB;gCAC1B,WAAW,EAAE,4CAA0C,OAAO,CAAC,IAAI,oBAAe,IAAI,CAAC,IAAI,CAAC,KAAK,SAAI,IAAI,CAAC,IAAI,CAAC,IAAI,OAAI;6BACxH,CAAC,CAAA;yBAEH;wBAED,sBAAO,IAAI,EAAC;;;;KACb;IACH,gBAAC;AAAD,CAAC,AArCD,CAAuC,eAAQ,GAqC9C"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 29f0768..279043c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "zincr", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -770,6 +770,29 @@ } } }, + "@primer/css": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@primer/css/-/css-12.6.2.tgz", + "integrity": "sha512-oysHWaq/dzu8bj6KF+30jnF8lao5XuecKl2RQKh+gTgojDfzIErmYAJQoJGvntH0tTrTr+9EfQd3O/fA3zPBPg==", + "requires": { + "@primer/octicons": "^9.1.1" + } + }, + "@primer/octicons": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@primer/octicons/-/octicons-9.1.1.tgz", + "integrity": "sha512-7EGM0+Kx39bIgaYr9bTCzFvBCxm+fqh/YJIoSns8zfCwss32ZJ2GDP3024UH709VQtM5cKFU4JcIYPHyGdSfIg==", + "requires": { + "object-assign": "^4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + } + } + }, "@types/babel__core": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.2.tgz", @@ -821,6 +844,7 @@ "version": "1.17.0", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.0.tgz", "integrity": "sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w==", + "dev": true, "requires": { "@types/connect": "*", "@types/node": "*" @@ -836,6 +860,7 @@ "version": "3.4.32", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.32.tgz", "integrity": "sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg==", + "dev": true, "requires": { "@types/node": "*" } @@ -844,6 +869,7 @@ "version": "2.0.37", "resolved": "https://registry.npmjs.org/@types/cookie-session/-/cookie-session-2.0.37.tgz", "integrity": "sha512-h8uZLDGyfAgER6kHbHlYWm1g/P/7zCBMOW6yT5/fQydVJxByJD4tohSvHBzJrGoLVmQJefQdfwuNkKb23cq29Q==", + "dev": true, "requires": { "@types/express": "*", "@types/keygrip": "*" @@ -853,6 +879,7 @@ "version": "4.17.0", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.0.tgz", "integrity": "sha512-CjaMu57cjgjuZbh9DpkloeGxV45CnMGlVd+XpG7Gm9QgVrd7KFq+X4HY0vM+2v0bczS48Wg7bvnMY5TN+Xmcfw==", + "dev": true, "requires": { "@types/body-parser": "*", "@types/express-serve-static-core": "*", @@ -863,6 +890,7 @@ "version": "4.16.7", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.7.tgz", "integrity": "sha512-847KvL8Q1y3TtFLRTXcVakErLJQgdpFSaq+k043xefz9raEf0C7HalpSY7OW5PyjCnY8P7bPW5t/Co9qqp+USg==", + "dev": true, "requires": { "@types/node": "*", "@types/range-parser": "*" @@ -902,12 +930,14 @@ "@types/keygrip": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.1.tgz", - "integrity": "sha1-/1QEYtL7TQqIRBzq8n0oewHD2Hg=" + "integrity": "sha1-/1QEYtL7TQqIRBzq8n0oewHD2Hg=", + "dev": true }, "@types/mime": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz", - "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==" + "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==", + "dev": true }, "@types/nock": { "version": "9.3.1", @@ -921,48 +951,14 @@ "@types/node": { "version": "10.14.15", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.15.tgz", - "integrity": "sha512-CBR5avlLcu0YCILJiDIXeU2pTw7UK/NIxfC63m7d7CVamho1qDEzXKkOtEauQRPMy6MI8mLozth+JJkas7HY6g==" - }, - "@types/oauth": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@types/oauth/-/oauth-0.9.1.tgz", - "integrity": "sha512-a1iY62/a3yhZ7qH7cNUsxoI3U/0Fe9+RnuFrpTKr+0WVOzbKlSLojShCKe20aOD1Sppv+i8Zlq0pLDuTJnwS4A==", - "requires": { - "@types/node": "*" - } - }, - "@types/passport": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/passport/-/passport-1.0.0.tgz", - "integrity": "sha512-R2FXqM+AgsMIym0PuKj08Ybx+GR6d2rU3b1/8OcHolJ+4ga2pRPX105wboV6hq1AJvMo2frQzYKdqXS5+4cyMw==", - "requires": { - "@types/express": "*" - } - }, - "@types/passport-github": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@types/passport-github/-/passport-github-1.1.5.tgz", - "integrity": "sha512-BeWDdLRWfPpJcmT1XofY5r1Av//TcxBEgllY4LnArcYdGqbIIVLyHwR+8bIG+ZC4PwJ6W1trnVEG3EQ+5J+Jmw==", - "requires": { - "@types/express": "*", - "@types/passport": "*", - "@types/passport-oauth2": "*" - } - }, - "@types/passport-oauth2": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@types/passport-oauth2/-/passport-oauth2-1.4.8.tgz", - "integrity": "sha512-tlX16wyFE5YJR2pHpZ308dgB1MV9/Ra2wfQh71eWk+/umPoD1Rca2D4N5M27W7nZm1wqUNGTk1I864nHvEgiFA==", - "requires": { - "@types/express": "*", - "@types/oauth": "*", - "@types/passport": "*" - } + "integrity": "sha512-CBR5avlLcu0YCILJiDIXeU2pTw7UK/NIxfC63m7d7CVamho1qDEzXKkOtEauQRPMy6MI8mLozth+JJkas7HY6g==", + "dev": true }, "@types/range-parser": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", - "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==" + "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==", + "dev": true }, "@types/request": { "version": "2.48.2", @@ -1003,6 +999,7 @@ "version": "1.13.2", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.2.tgz", "integrity": "sha512-/BZ4QRLpH/bNYgZgwhKEh+5AsboDBcUdlBYgzoLX0fpj3Y2gp6EApyOlM3bK53wQS/OE1SrdSYBAbux2D1528Q==", + "dev": true, "requires": { "@types/express-serve-static-core": "*", "@types/mime": "*" @@ -1548,11 +1545,6 @@ } } }, - "base64url": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/base64url/-/base64url-3.0.1.tgz", - "integrity": "sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==" - }, "basic-auth": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", @@ -6173,6 +6165,15 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, + "json-to-pretty-yaml": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/json-to-pretty-yaml/-/json-to-pretty-yaml-1.2.2.tgz", + "integrity": "sha1-9M0L0KXo/h3yWq9boRiwmf2ZLVs=", + "requires": { + "remedial": "^1.0.7", + "remove-trailing-spaces": "^1.0.6" + } + }, "json5": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", @@ -6468,6 +6469,11 @@ "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, + "lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=" + }, "lodash.unescape": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", @@ -8069,11 +8075,6 @@ } } }, - "oauth": { - "version": "0.9.15", - "resolved": "https://registry.npmjs.org/oauth/-/oauth-0.9.15.tgz", - "integrity": "sha1-vR/vr2hslrdUda7VGWQS/2DPucE=" - }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -8369,40 +8370,6 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, - "passport": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/passport/-/passport-0.4.0.tgz", - "integrity": "sha1-xQlWkTR71a07XhgCOMORTRbwWBE=", - "requires": { - "passport-strategy": "1.x.x", - "pause": "0.0.1" - } - }, - "passport-github": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/passport-github/-/passport-github-1.1.0.tgz", - "integrity": "sha1-jOHj/NYa11eOsd9ZWDnkrqEjVdQ=", - "requires": { - "passport-oauth2": "1.x.x" - } - }, - "passport-oauth2": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/passport-oauth2/-/passport-oauth2-1.5.0.tgz", - "integrity": "sha512-kqBt6vR/5VlCK8iCx1/KpY42kQ+NEHZwsSyt4Y6STiNjU+wWICG1i8ucc1FapXDGO15C5O5VZz7+7vRzrDPXXQ==", - "requires": { - "base64url": "3.x.x", - "oauth": "0.9.x", - "passport-strategy": "1.x.x", - "uid2": "0.0.x", - "utils-merge": "1.x.x" - } - }, - "passport-strategy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", - "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=" - }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -8455,11 +8422,6 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, - "pause": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", - "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -9043,12 +9005,22 @@ "rc": "^1.0.1" } }, + "remedial": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/remedial/-/remedial-1.0.8.tgz", + "integrity": "sha512-/62tYiOe6DzS5BqVsNpH/nkGlX45C/Sp6V+NtiN6JQNS1Viay7cWkazmRkrQrdFj2eshDe96SIQNIoMxqhzBOg==" + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", "dev": true }, + "remove-trailing-spaces": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/remove-trailing-spaces/-/remove-trailing-spaces-1.0.7.tgz", + "integrity": "sha512-wjM17CJ2kk0SgoGyJ7ZMzRRCuTq+V8YhMwpZ5XEWX0uaked2OUq6utvHXGNBQrfkUzUUABFMyxlKn+85hMv4dg==" + }, "repeat-element": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", @@ -10284,11 +10256,6 @@ "source-map": "~0.6.1" } }, - "uid2": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", - "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=" - }, "undefsafe": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.2.tgz", @@ -10591,6 +10558,11 @@ "extsprintf": "^1.2.0" } }, + "vue": { + "version": "2.6.10", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz", + "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==" + }, "w3c-hr-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", diff --git a/package.json b/package.json index 3c52233..06db08f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "zincr", "version": "1.0.5", - "description": "Compliance Bot for Zalando", + "description": "Compliance and Security Checker", "author": "Per Ploug ", "license": "MIT", "repository": "https://github.com/perploug/4-eyesbot.git", @@ -19,21 +19,24 @@ "test:watch": "jest --watch --notify --notifyMode=change --coverage" }, "dependencies": { - "@types/cookie-session": "^2.0.37", - "@types/express": "^4.17.0", - "@types/passport-github": "^1.1.5", + "@primer/css": "^12.6.2", + "body-parser": "^1.19.0", "cookie-session": "^1.3.3", + "js-yaml": "^3.13.1", + "json-to-pretty-yaml": "^1.2.2", "license-lookup": "0.0.20", - "passport": "^0.4.0", - "passport-github": "^1.1.0", + "lodash.throttle": "^4.1.1", "probot": "^7.5.3", - "request-promise": "^4.2.2" + "request-promise": "^4.2.2", + "vue": "^2.6.10" }, "devDependencies": { "@types/jest": "^23.3.14", "@types/nock": "^9.3.1", "@types/node": "^10.14.15", "@types/request-promise": "^4.1.44", + "@types/cookie-session": "^2.0.37", + "@types/express": "^4.17.0", "eslint-plugin-typescript": "^0.12.0", "jest": "^24.8.0", "nock": "^10.0.6", diff --git a/public/components.js b/public/components.js new file mode 100644 index 0000000..675ac4d --- /dev/null +++ b/public/components.js @@ -0,0 +1,188 @@ +Vue.component("data-classifier", { + props: { + datatypes: Object, + type: String, + classification: String + }, + + computed: { + filteredTypes: function() { + return this.datatypes[this.type].classification; + }, + + selectedType: function() { + return this.datatypes[this.type].classification[this.classification].ex; + } + }, + + methods: { + dataTypeButtonClass: function(classification) { + return "dt-" + classification; + }, + + toggle: function(color) { + this.$emit("update:color", color); + } + }, + + template: ` + +
+ + + +
+
+

{{classification}} {{type}} data

+

{{selectedType}}

+
+
+ +
+ ` +}); + +Vue.component("menu-overlay", { + props: { + value: [String, Number], + items: Array, + width: String, + valueField: String + }, + + data: function() { + return { + open: false + }; + }, + + methods: { + created: function() {}, + toggle: function() { + this.open = this.open ? false : true; + }, + select: function(selected) { + this.open = false; + this.$emit("input", selected[this.valueField]); + } + }, + + computed: { + display: function() { + if (this.value) { + var find = this.items.filter(x => x[this.valueField] == this.value); + console.log(find); + + if (find.length > 0) { + return find[0]; + } else { + this.$emit("input", null); + return null; + } + } + return null; + } + }, + + template: ` + +
+ + + + {{display}} + Select... + + + + + +
+ + + + + ` +}); + +Vue.component("dialog-overlay", { + props: { + title: String, + width: [String, Number], + height: [String, Number], + enableDelete: Boolean + }, + + methods: { + submit: function() { + this.$emit("submit"); + }, + cancel: function() { + this.$emit("cancel"); + }, + deleteItem: function() { + this.$emit("delete"); + } + }, + + computed: { + style: function() { + return { + width: this.width + "px", + height: this.height + "px", + "margin-top": -this.height / 2 + "px", + "margin-left": -this.width / 2 + "px" + }; + } + }, + + created: function() {}, + + template: ` +
+ +
+ +
+

+ {{title}} +

+
+
+ +
+ +
+
+ ` +}); diff --git a/public/data.js b/public/data.js new file mode 100644 index 0000000..133c13b --- /dev/null +++ b/public/data.js @@ -0,0 +1,372 @@ +export default { + async getScenarios() { + return [ + { + data: 1, + id: 1, + type: "confidentiality", + description: + "Cras porta lobortis mi, a feugiat elit ultricies sit amet. Duis hendrerit felis a est consequat mollis id at dolor. Nulla eu ligula odio. Nunc consequat justo sit amet urna egestas, a congue quam congue. Aenean pharetra quam sed auctor fermentum.", + issue: "#2312", + + outcomes: [ + { + type: { + reputation: "high", + productivity: "low" + }, + description: "Something something" + }, + { + type: { + reputation: "high", + productivity: "low" + }, + description: "Something something" + } + ], + + threats: [] + }, + { + data: 2, + id: 2, + type: "integrity", + description: + "Vestibulum a purus a eros maximus accumsan. Donec ornare cursus condimentum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas", + issue: "#1234", + outcomes: [], + threats: [] + }, + { + data: 1, + id: 3, + type: "availability", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis mollis sapien, et luctus nulla. Donec nec tempus nisi, quis faucibus nisl. Nulla sit amet elementum quam, ac rutrum augue", + outcomes: [], + threats: [] + } + ]; + }, + + getOutcome() { + // owasp top 10: + return { + reputation: { + label: "Injection", + url: "", + description: + "Injection flaws occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing data without proper authorization." + } + }; + }, + + getThreats() { + // owasp top 10: + return { + a1: { + label: "Injection", + url: "", + description: + "Injection flaws occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing data without proper authorization." + }, + a2: { + label: "Broken auth", + url: "", + description: + "an attacker uses leaks or flaws in the authentication or session management functions to impersonate other users." + }, + a3: { + label: "XSS", + url: "", + description: + "XSS flaws occur whenever an application takes untrusted data and sends it to a web browser without proper validation or escaping. XSS allows attackers to execute scripts in the victims' browser, which can access any cookies, session tokens, or other sensitive information retained by the browser, or redirect user to malicious sites." + }, + a4: { + label: "Insecure Direct Object References", + url: "", + description: + "A direct object reference occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, or database key. Without an access control check or other protection, attackers can manipulate these references to access unauthorized data." + }, + a5: { + label: "Misconfiguration", + url: "", + description: + "This vulnerability allows an attacker to accesses default accounts, unused pages, unpatched flaws, unprotected files and directories, etc. to gain unauthorized access to or knowledge of the system. Security misconfiguration can happen at any level of an application stack, including the platform, web server, application server, database, framework, and custom code." + }, + a6: { + label: "Sensitive Data", + url: "", + description: + "This vulnerability allows an attacker to access sensitive data such as credit cards, tax IDs, authentication credentials, etc to conduct credit card fraud, identity theft, or other crimes. Losing such data can cause severe business impact and damage to the reputation. Sensitive data deserves extra protection such as encryption at rest or in transit, as well as special precautions when exchanged with the browser." + }, + a7: { + label: "Access Controls", + url: "", + description: + "Most web applications verify function level access rights before making that functionality visible in the UI. However, applications need to perform the same access control checks on the server when each function is accessed." + }, + a8: { + label: "CSRF", + url: "", + description: + "A CSRF attack forces a logged-on victim’s browser to send a forged HTTP request, including the victim’s session cookie and any other automatically included authentication information, to a vulnerable web application. This allows the attacker to force the victim’s browser to generate requests that the vulnerable application processes as legitimate requests from the victim." + }, + a9: { + label: "Insecure dependencies", + url: "", + description: + "Components, such as libraries, frameworks, and other software modules, almost always run with full privileges. If a vulnerable component is exploited, such an attack can facilitate serious data loss or server takeover. Applications using components with known vulnerabilities may undermine application defenses and enable a range of possible attacks and impacts." + }, + a10: { + label: "Redirects", + url: "", + description: + "Web applications frequently redirect and forward users to other pages and websites, and use untrusted data to determine the destination pages. Without proper validation, attackers can redirect victims to phishing or malware sites, or use forwards to access unauthorized pages." + }, + a0: { + label: "Other", + url: "", + description: + "Threats which is not covered by the OWASP top 10, such as social engineering" + } + }; + }, + + async getClassifiedData() { + return [ + { + id: 1, + label: "Customer Profiles", + type: "customer", + classification: "red", + quantity: "10000", + access: [], + notes: + "Cras porta lobortis mi, a feugiat elit ultricies sit amet. Duis hendrerit felis a est consequat mollis id at dolor. Nulla eu ligula odio. Nunc consequat justo sit amet urna egestas, a congue quam congue. Aenean pharetra quam sed auctor fermentum." + }, + { + id: 2, + label: "Article data", + type: "stock", + classification: "green", + quantity: "10000", + access: [], + notes: + "Publicly known article descriptions, pharetra quam sed auctor fermentum." + } + ]; + }, + + async getSourceTypes() { + return { + employee: { + label: "Employee Data", + default: "green", + icon: "fas fa-user-tie", + + classification: { + green: { + ex: + "Contains no identifiable info, which can be linked to an employee" + } + } + }, + customer: { + label: "Customer Data", + default: "orange", + icon: "fas fa-user", + + classification: { + green: { + ex: + "Contains no identifiable info, which can be linked to a customer" + }, + + yellow: { + ex: + "Contains no identifiable info, which can be linked to a customer" + }, + orange: { + ex: `Customer names, + email, telephone number, + address, date of birth, purchase + and order data or any other data + that can be linked to a customer + by means of (any kind of) + identifiers` + }, + red: { + ex: `Criminal conviction, + ethnic/racial origin, + health, religious, + trade union + membership, sexual + orientation/activity, + political opinions; + customer payment + details/instruments + information (in + particular credit + card/PCI data)` + } + } + }, + + stock: { + label: "Stock Data", + default: "red", + icon: "fas fa-box", + + classification: { + green: { + ex: + "Contains no identifiable info, which can be linked to a customer" + }, + + yellow: { + ex: + "Contains no identifiable info, which can be linked to a customer" + }, + orange: { + ex: `Customer names, + email, telephone number, + address, date of birth, purchase + and order data or any other data + that can be linked to a customer + by means of (any kind of) + identifiers` + }, + red: { + ex: `Criminal conviction, + ethnic/racial origin, + health, religious, + trade union + membership, sexual + orientation/activity, + political opinions; + customer payment + details/instruments + information (in + particular credit + card/PCI data)` + } + } + } + }; + }, + + async getIssues() { + const url = window.location.pathname + "/issues"; + const response = await fetch(url); + if (response.ok) { + return response.json(); + } + + throw new Error("Could not retrieve issues for " + url); + }, + + async getAssessment() { + const url = window.location.pathname + "/assessment"; + const response = await fetch(url); + if (response.ok) { + return response.json(); + } + + throw new Error("Could not retrieve issues for " + url); + }, + + async saveAssessment(data) { + const url = window.location.pathname + "/assessment/"; + const response = await fetch(url, { + method: "POST", // *GET, POST, PUT, DELETE, etc. + cache: "no-cache", // *default, no-cache, reload, force-cache, only-if-cached + credentials: "same-origin", // include, *same-origin, omit + headers: { + "Content-Type": "application/json" + }, + redirect: "follow", // manual, *follow, error + referrer: "no-referrer", // no-referrer, *client + body: JSON.stringify(data) // body data type must match "Content-Type" header + }); + + if (response.ok) { + return response.json(); + } + + throw new Error("Could not post assessment to " + url); + }, + + async getConfig() { + var config = { + category: [ + { + id: "confidentiality", + label: "Confidentiality", + description: "What happens if all the data is disclosed to the world?" + }, + { + id: "integrity", + label: "Integrity", + description: + "What happens if the data is incorrect, misleading, defaced?" + }, + { + id: "availability", + label: "Availability", + description: + "What happens if the data or service is missing, deleted or unreachable?" + } + ], + + access: { + Create: "Creates new records", + Read: "Reads existing records", + Update: "Updates existing records", + Delete: "Deletes existing records" + }, + + records: { + "10": "No more than 10", + "1000": "Less than 1000", + "10000": "Between 1.000 and 10.000", + "100000": "Between 10.000 and 100.000", + "+100000": "More than 100.000" + }, + + owasp: this.getThreats(), + + impact: { + reputation: { + description: "Who would notice the incident occurring?", + levels: { + low: "Insiders", + medium: "Customers", + high: "Industry news", + maximum: "Mainstream news" + } + }, + productivity: { + description: "Amount of unplanned effort to resolve the incident?", + levels: { + low: "24h < team effort", + medium: "> 2d team effort", + high: "Week long effort", + maximum: "Big company effort" + } + }, + financial: { + description: "Direct or indirect loss of money due to incident", + levels: { + low: "No financial loss", + medium: ">1k eur loss", + high: "~10k eur loss", + maximum: "More?" + } + } + } + }; + return config; + } +}; diff --git a/public/risk.js b/public/risk.js new file mode 100644 index 0000000..7748d84 --- /dev/null +++ b/public/risk.js @@ -0,0 +1,251 @@ +import riskdata from "./data.js"; + +const debounce = (func, delay) => { + let inDebounce; + return function() { + const context = this; + const args = arguments; + clearTimeout(inDebounce); + inDebounce = setTimeout(() => func.apply(context, args), delay); + }; +}; + +// @ts-ignore +var app = new Vue({ + el: "#app", + delimiters: ["${", "}"], + + created: async function() { + this.config = await riskdata.getConfig(); + this.datasources.types = await riskdata.getSourceTypes(); + var assessment = await riskdata.getAssessment(); + + this.classified = assessment && assessment.data ? assessment.data : []; + this.scenarios = assessment && assessment.events ? assessment.events : []; + + this.issues = await riskdata.getIssues(); + }, + + updated: function() { + debounce(this.mapLines(this.scenarios), 10000); + }, + + data: { + test: null, + config: {}, + + datasources: { + dataSourceModel: null, + types: {} + }, + + classified: [], + scenarios: [], + issues: [], + + threatEditor: { + lines: [], + threat: null, + event: null, + outcome: null + } + }, + + computed: { + classifiedData: function() { + var data = this.classified; + + data.map(x => { + x.sourcetype = this.datasources.types[x.type]; + }); + + return data; + }, + + filteredThreats: function() { + var threats = this.config.threats; + return threats; + }, + + filteredEvents: function() { + var events = this.scenarios; + events.map(x => { + x.datasource = this.classified.filter(d => d.id === x.data)[0]; + }); + + return events; + }, + + filteredOutcomes: function() { + return this.consequences; + }, + + filteredIssues: function() { + var issues = this.issues; + return issues; + } + }, + + methods: { + datasource_new: function(type, name) { + var source = this.datasources.dataSourceModel || { + label: "", + quantity: "+100.000", + note: "", + access: [] + }; + + source.type = name; + source.classification = type.default; + + this.datasources.dataSourceModel = source; + }, + + datasource_edit: function(model) { + this.datasources.dataSourceModel = model; + }, + + datasource_save: function(model) { + if (!model.id) { + model.id = Math.max(this.classified.map(x => x.id)) + 1; + this.classified.push(model); + } else { + var elementPos = this.classified.map(x => x.id).indexOf(model.id); + if (elementPos >= 0) { + this.classified[elementPos] = model; + } else { + this.classified.push(model); + } + } + + this.datasources.dataSourceModel = null; + }, + + datasource_delete: function(index) { + this.classified.splice(index, 1); + }, + + assessment_save: async function() { + await riskdata.saveAssessment({ + data: this.classified, + events: this.scenarios + }); + }, + + threat_new: function(event, threat) { + var t = { + category: "", + description: "" + }; + if (threat) { + t.category = threat.category; + t.description = threat.description; + t.editingThreat = threat; + } + t.editingEvent = event; + this.threatEditor.threat = t; + }, + + threat_save: function(model) { + if (model.editingThreat) { + model.editingThreat.category = model.category; + model.editingThreat.description = model.description; + } else if (model.editingEvent) { + model.editingEvent.threats.push({ + category: model.category, + description: model.description + }); + } + this.threatEditor.threat = null; + }, + + event_new: function(event) { + var e = { + category: "", + description: "", + threats: [], + outcomes: [] + }; + + if (event) { + e.type = event.type; + e.description = event.description; + e.data = event.data; + e.editingEvent = event; + } + + this.threatEditor.event = e; + }, + + event_save: function(model) { + if (model.editingEvent) { + model.editingEvent.type = model.type; + model.editingThreat.description = model.description; + model.editingThreat.data = model.data; + } else { + this.scenarios.push(model); + } + + this.threatEditor.event = null; + }, + + outcome_new: function(event) { + event.outcomes.push({ + type: "reputation", + impact: "high", + description: "Something something" + }); + }, + + outcome_save: function(model) { + if (model.editingOutcome) { + model.editingOutcome.category = model.category; + model.editingOutcome.description = model.description; + } else if (model.editingEvent) { + model.editingEvent.outcomes.push({ + category: model.category, + description: model.description + }); + } + this.threatEditor.outcome = null; + }, + + dataTypeRowClass: function(color) { + return "dt-" + color; + }, + + mapLines: function(events) { + console.log("Mapping lines"); + + var lines = this.threatEditor.lines; + lines.forEach(x => x.remove()); + lines.length = 0; + + events.forEach(event => { + var e_el = "e_" + event.id; + + event.threats.forEach((threat, index) => { + var t_el = e_el + "_t_" + index; + + lines.push( + new LeaderLine( + document.getElementById(t_el), + document.getElementById(e_el) + ) + ); + }); + + event.outcomes.forEach((outcome, index) => { + var o_el = e_el + "_o_" + index; + + lines.push( + new LeaderLine( + document.getElementById(e_el), + document.getElementById(o_el) + ) + ); + }); + }); + } + } +}); diff --git a/src/app/assessment.ts b/src/app/assessment.ts new file mode 100644 index 0000000..a1c70a8 --- /dev/null +++ b/src/app/assessment.ts @@ -0,0 +1,140 @@ +import { getOctokit } from "./octokit"; +import { Request, Response } from "express"; +//@ts-ignore +import YAML = require('json-to-pretty-yaml'); + +//@ts-ignore +import yamltojs = require('js-yaml'); +import { GitHubAPI } from "probot/lib/github"; + +const ghe_host = process.env.GHE_HOST; +const rr_branch = "rapid-risk"; +//const master_branch = "master"; +const rr_file = "risks.md"; + +async function ensureBranch(branch : string){ + // get all refs + // if no risk branch, create one from master +} + +async function createOrUpdatePr(branch : string, risks: any){ + // get all PRs from rapid-risk branch + // create or update PR with correct desription. + + return {data: "meh"}; +} + +async function getRiskFile(octokit : GitHubAPI, repo : {owner: string, repo: string}, branch : string = ''){ + try{ + var req = { path: rr_file, ...repo }; + if(branch !== ''){ + //@ts-ignore + req.ref = branch; + } + + //get the risk file from branch + var response = await octokit.repos.getContents(req); + if(response.status === 200){ + return response.data; + } + }catch(ex){ + console.log(ex); + return null + } +}; + +async function updateRiskFile(content : string, sha : string, octokit : GitHubAPI, repo : {owner: string, repo: string}, branch : string){ + try{ + const yaml = Buffer.from(YAML.stringify(content)).toString('base64'); + await octokit.repos.updateFile({...repo, path: rr_file, sha: sha, content: yaml, message: "updated risk file", branch: branch}); + return true; + }catch(ex){ + return false; + } +}; + +export async function postAssessment(req : Request, res: Response){ + if(req.session && ghe_host){ + + try { + var octokit = getOctokit(ghe_host, req.session.token); + const gh_repo = {owner: req.params.owner, repo: req.params.repo }; + + // try to get rapid-risk branch / rapid risk PR + var branched_riskFile = await getRiskFile(octokit, gh_repo, rr_branch); + if(!branched_riskFile){ + await ensureBranch(rr_branch); + await updateRiskFile(req.body, "null", octokit, gh_repo, rr_branch); + }else{ + await updateRiskFile(req.body, branched_riskFile.sha, octokit, gh_repo, rr_branch); + } + + var pr = await createOrUpdatePr(rr_branch, req.body); + res.sendStatus(200).send(pr.data); + } catch (err) { + // It threw an error so they can't see the repo + res.send(err); + } + }else{ + res.send("no session"); + } +}; + + + +export async function getAssessment(req : Request, res : Response){ + + if(req.session && ghe_host){ + + try { + var octokit = getOctokit(ghe_host, req.session.token); + + // If this doesn't throw, they can see the repo + const gh_repo = {owner: req.params.owner, repo: req.params.repo }; + + try{ + //get the risk branch + //var branch = await octokit.repos.getBranch({branch: rr_branch, ...gh_repo}); + var riskFile = await getRiskFile(octokit, gh_repo, rr_branch); + if(!riskFile){ + riskFile = await getRiskFile(octokit, gh_repo); + } + + if(!riskFile){ + riskFile = {}; + } + var content = yamltojs.safeLoad(new Buffer(riskFile.content, 'base64').toString('ascii')) + res.status(200).send(content); + }catch(ex){ + res.status(500).send(ex); + } + } catch (err) { + // It threw an error so they can't see the repo + res.status(500).send(err); + } + + //res.send(`Hey, you made it! - Repo: ${req.params.owner}/${req.params.repo} user:` + req.session.login); + }else{ + res.send("no session"); + } +}; + +export async function getUi(req : Request, res : Response){ + + if(req.session && ghe_host){ + + var octokit = getOctokit(ghe_host, req.session.token); + + // If this doesn't throw, they can see the repo + const gh_repo = {owner: req.params.owner, repo: req.params.repo }; + + try{ + var repo = await octokit.repos.get({...gh_repo}); + res.render("../../../views/risky.hbs", {repo: repo.data}); + }catch(ex){ + res.status(500).send(ex); + } + }else{ + res.send("no session"); + } +} \ No newline at end of file diff --git a/src/app/issues.ts b/src/app/issues.ts new file mode 100644 index 0000000..cb6d353 --- /dev/null +++ b/src/app/issues.ts @@ -0,0 +1,50 @@ +import { getOctokit } from "./octokit"; +import { Request, Response } from "express"; + +const ghe_host = process.env.GHE_HOST; + +export async function getIssues(req : Request, res: Response){ + if(req.session && ghe_host){ + + try { + var octokit = getOctokit(ghe_host, req.session.token); + const gh_repo = {owner: req.params.owner, repo: req.params.repo }; + const issues = await octokit.issues.listForRepo({...gh_repo, labels: 'risk'});; + res.send(issues.data); + + }catch(ex){ + res.status(500).send(ex); + } + }else{ + res.send("no session"); + } +}; + +export async function postIssue(req : Request, res: Response){ + if(req.session && ghe_host){ + + + //var octokit = getOctokit(ghe_host, req.session.token); + /* + var ev = req.body; + //ev.datasource + //ev.threats.label + + // how do we construct a fairly generic body here to convey info of threats -> event -> consequeces + var body = { + title: + } + + const gh_repo = {owner: req.params.owner, repo: req.params.repo }; + const issues = await octokit.issues.create({...gh_repo, title}) .listForRepo({...gh_repo, labels: 'risk'});; + res.send(issues.data); + + }catch(ex){ + res.status(500).send(ex); + } + }else{ + res.send("no session"); + }*/ + + } +}; \ No newline at end of file diff --git a/src/auth/oauth.ts b/src/app/oauth.ts similarity index 81% rename from src/auth/oauth.ts rename to src/app/oauth.ts index c877ce0..38c1581 100644 --- a/src/auth/oauth.ts +++ b/src/app/oauth.ts @@ -1,11 +1,10 @@ -import { Router } from "express"; - +import { Router, Request, Response } from "express"; const request = require('request') const querystring = require('querystring') const {promisify} = require('util') - const post = promisify(request.post) + export function oauth(router : Router) { const gh_host = process.env.GHE_HOST || "github.com"; @@ -49,4 +48,14 @@ export function oauth(router : Router) { res.send('Invalid code') } }) -} \ No newline at end of file +} + +export async function authenticate (req : Request, res : Response, next : Function) { + if (!req.session || !req.session.token) { + req.session = {} + req.session.redirect = req.originalUrl + res.redirect('/github/login') + } else { + next() + } +} diff --git a/src/app/octokit.ts b/src/app/octokit.ts new file mode 100644 index 0000000..5febfc2 --- /dev/null +++ b/src/app/octokit.ts @@ -0,0 +1,16 @@ +import { GitHubAPI } from "probot/lib/github"; + +export function getOctokit(host : string, token : string){ + const octokit = GitHubAPI({ + baseUrl: `https://${host}/api/v3`, + logger: { + debug: () => {}, + info: () => {}, + warn: console.warn, + error: console.error + }, + }); + + octokit.authenticate({ type: 'token', token: token }); + return octokit; +} \ No newline at end of file diff --git a/src/app/pullrequest.ts b/src/app/pullrequest.ts new file mode 100644 index 0000000..1e9118b --- /dev/null +++ b/src/app/pullrequest.ts @@ -0,0 +1,20 @@ +import { IAppParams } from "../interfaces/params/iappparams"; +import { AppConfig, getTasksConfig } from "../config/app"; +import { Zincr } from "../zincr"; +import { Context } from "probot"; + +export async function processPullRequest(context : Context) { + const params : IAppParams = { + repo: context.repo(), + organization: null, + taskconfig: await getTasksConfig(context), + appconfig: AppConfig + }; + + if(context.payload.repository.organization && context.payload.repository.organization.login){ + params.organization = context.payload.repository.organization.login; + } + + var zincr = new Zincr(params); + await zincr.onChange(context); +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 273b104..2441b01 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,55 +1,32 @@ -import { Application, Context } from "probot"; -import { AppConfig, getTasksConfig } from "./config/app" -import { Zincr } from "./zincr"; -import { IAppParams } from "./interfaces/params/iappparams"; -import { Router, Request, Response } from "express"; +import { Application} from "probot"; +import { Router } from "express"; + import cookieSession = require("cookie-session"); -import {oauth} from "./auth/oauth"; -import { GitHubAPI } from "probot/lib/github"; +import express = require("express"); +import path = require("path"); +import bodyParser = require('body-parser'); + +// @ts-ignore +import YAML = require('json-to-pretty-yaml'); + +import {oauth, authenticate} from "./app/oauth"; + +// controllers +import { postAssessment, getAssessment, getUi} from "./app/assessment" +import { getIssues, postIssue } from "./app/issues"; +import { processPullRequest } from "./app/pullrequest"; -console.log(process.env); export = (app: Application) => { - const setStatusPass = require("./set-status-pass"); - const events = ["pull_request", "pull_request_review"]; // Runs the check on all pull request and review events + const events = ["pull_request", "pull_request_review"]; app.on(events, processPullRequest); - app.on('check_run.requested_action', setStatusPass) - - async function processPullRequest(context : Context) { - - const params : IAppParams = { - repo: context.repo(), - organization: null, - taskconfig: await getTasksConfig(context), - appconfig: AppConfig - }; - - if(context.payload.repository.organization && context.payload.repository.organization.login){ - params.organization = context.payload.repository.organization.login; - } - - var zincr = new Zincr(params); - await zincr.onChange(context); - } - - // Functionality for risky UI and auth against GHE + + // Router for authenticating against github enterprise const server : Router = app.route(); - //const client_id = process.env.CLIENT_ID; - //const client_secret = process.env.CLIENT_SECRET; - const ghe_host = process.env.GHE_HOST; - async function authenticate (req : Request, res : Response, next : Function) { - if (!req.session || !req.session.token) { - req.session = {} - req.session.redirect = req.originalUrl - res.redirect('/github/login') - } else { - next() - } - } - + // authentication configuration for github oauth if(process.env.WEBHOOK_SECRET){ server.use(cookieSession({ name: 'session', @@ -58,88 +35,37 @@ export = (app: Application) => { })); } + //setup routes for oauth oauth(server); + // middleware to enforce redirect on missing auth server.use(async (req, res, next) => { if(req.session){ - + if (req.session.token) { var gh = await app.auth() gh.authenticate({ type: 'token', token: req.session.token }) - + if (!req.session.login) { req.session.login = (await gh.users.getAuthenticated({})).data.login } - } } next() }) - server.get('/risky/:owner/:repo', authenticate, async (req, res) => { - if(req.session && ghe_host){ - - try { - - const octokit = GitHubAPI({ - baseUrl: `https://${ghe_host}/api/v3`, - logger: { - debug: () => {}, - info: () => {}, - warn: console.warn, - error: console.error - }, - }); - octokit.authenticate({ type: 'token', token: req.session.token }); - - // If this doesn't throw, they can see the repo - const gh_repo = {owner: req.params.owner, repo: req.params.repo }; - const repo = await octokit.repos.get(gh_repo); - const riskFile = await octokit.repos.getContents({ path: "risks.md", ...gh_repo }); - - //todo, parse and process the risk file - - res.render("../../../views/risky", {repo: repo.data, risks: riskFile.data}); - - } catch (err) { - // It threw an error so they can't see the repo - res.send(err); - } - - - //res.send(`Hey, you made it! - Repo: ${req.params.owner}/${req.params.repo} user:` + req.session.login); - }else{ - res.send("no session"); - } - }); - - - /* - server.get('/login', async (req, res) => { - const querystring = require('querystring'); - - //get needed values - const client_id = process.env.CLIENT_ID; - const ghe_host = process.env.GHE_HOST; - - if(!client_id || !ghe_host) - return; - - // GitHub needs us to tell it where to redirect users after they've authenticated - const protocol = req.headers['x-forwarded-proto'] || req.protocol - const host = req.headers['x-forwarded-host'] || req.get('host') - - const params = querystring.stringify({ - client_id: client_id, - redirect_uri: `${protocol}://${host}/login/cb` - }) - - const url = `https://${ghe_host}/login/oauth/authorize?${params}` - res.redirect(url) - }); - */ - + // Functionality for risk UI + const zincr_app : Router = app.route("/zincr"); + zincr_app.use( bodyParser.json() ); + zincr_app.use('/libs', express.static(path.join(__dirname, '../node_modules'))); + zincr_app.use("/public", express.static(path.join(__dirname, '../public'))); + // routes + zincr_app.post('/risk/:owner/:repo/issue', authenticate, postIssue); + zincr_app.get('/risk/:owner/:repo/issues', authenticate, getIssues ); + zincr_app.post('/risk/:owner/:repo/assessment', authenticate, postAssessment); + zincr_app.get('/risk/:owner/:repo/assessment', authenticate, getAssessment); + zincr_app.get('/risk/:owner/:repo', authenticate, getUi); }; diff --git a/src/tasks/risks.ts b/src/tasks/risks.ts index 2bb89f8..c20b1be 100644 --- a/src/tasks/risks.ts +++ b/src/tasks/risks.ts @@ -18,6 +18,7 @@ export default class RisksTask extends BaseTask { async run(context: Context){ + //todo determine the last update date and changes made to the repo since then... const riskfile = await context.github.repos.getContents( { ...this.repo, path: "risks.md" } ); if(riskfile.status !== 200) { @@ -25,7 +26,7 @@ export default class RisksTask extends BaseTask { this.result.push({ label: "No risks.md file found", result: StatusEnum.Failure, - description: `Create a risks.md file - [Click here](https://${context.host}/risky/${this.repo.owner}/${this.repo.repo}/)` + description: `Create a risks.md file - [Click here](https://${context.host}/zincr/risk/${this.repo.owner}/${this.repo.repo}/)` }) }else{ @@ -33,7 +34,7 @@ export default class RisksTask extends BaseTask { this.result.push({ label: "Please update your Risks.md file", result: StatusEnum.Failure, - description: ` [Update your risk assessment](https://${context.host}/risky/${this.repo.owner}/${this.repo.repo}/)` + description: ` [Update your risk assessment](https://${context.host}/zincr/risk/${this.repo.owner}/${this.repo.repo}/)` }) } diff --git a/views/risky.hbs b/views/risky.hbs index 68ab02a..57ea5c2 100644 --- a/views/risky.hbs +++ b/views/risky.hbs @@ -6,16 +6,52 @@ Setup {{#if pkg.name }}{{ pkg.name }}{{else}}Your App{{/if}} | built with Probot - - + + + + + + + + - -
+ + +

Rapid Risk Assessment for /{{repo.full_name}}

+
-
Rapid risk assessment (RRA) is a lightweight decision-making process which @@ -27,9 +63,8 @@
- -
+
Risk Score

HIGH

@@ -37,9 +72,9 @@
Data Sources -

4

+

${classifiedData.length}

- +
Data Classification

RED

@@ -47,177 +82,380 @@
Open Risks -

3

+

${scenarios.length}

+
+
+ +

1. Classify data processed by {{repo.name}}

+

Register and classify all data processed by this service

+ + + + +
+
+
-
- - -
- - -

1. Register data processed by {{repo.name}}

-

Register and classify all data processed by this service

- - Customer Data - Employee Data - Stock Data - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Data Type - - Approximate # of records - - Notes -
- - Customer Profiles - - +100.000 RecordsUsed by the customer profile form
- - Customer Shopping History - - <100 RecordsUsed in the recommendation widget
- - Article meta data - - +100.000 RecordsUsed in article display
- - Creditcard data - - +100.000 RecordsUsed in article display
-

-

2. Outline attack scenarios

-

Discuss potential attack scenarios, to figure out what the worst case - scenarios could be. Keep these notes -

+
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+ + +
- +

2. Outline attack scenarios

+

+ Discuss potential attack scenarios, evaluate what each scenario could + lead to, what is the outcome, and what is the impact of the scenario. + Documentation on how to validate and prioritise using the bowtie model +

-
+
-

3. Validate And Prioritise

-

Based on your outlined scenarios above, evaluate what each scenario could - lead to, what is the outcome, and what is the impact of the scenario. - Documentation on how to validate and prioritise using the bowtie model -

- -

- After validating and priortising your scenarios, log them in your issue - tracker tagged with the tag risk -

+
+
+ + ${threat.category}: ${threat.description} +
+
- Open Issue Tracker +
+
-
+ Someone affects the ${event.type} of + ${event.datasource.label} by: + ${event.description} + + + +
-
Current Issues
-

All risk-related issues logged by the team in the {{repo.name}} issue tracker tagged as - risk -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Task - - Priority - - State - - Created -
Enforce 2FA on admin dashboard loginHighIn progress16 days ago
Create daily digests to monitor usageLowFixed20 days ago
Implement CSP on the admin UI to mitigate XSS riskLowIn progress6 days ago
Review access to logging service and data storedMediumIn progress16 days ago
+
+ +
+ + + Related to issue: ${event.issue} + + + +
+
+
+
+
+
+
${outcome.description}
+ + +
+ +
+ +
+ +
+ + +
+
+ + +
+
+
+
+
- +
-
-
-

Need help?

-
- Documentation - Chat on Google Chat + +
+ +

3. Logged issues

+

+ After validating and priortising your scenarios, log them in your issue + tracker tagged with the tag risk +

+ + Open Issue Tracker + + + + + + + + + + + + + + + + + + + + +
+ Task + + Priority + + State + + Created +
#${issue.number}${issue.title}High${issue.state}${issue.created_at}
+ + + + + + + + +
+
+
+ + +
+
+ +
+
+
+ +
+
+
+ + + + + Describe your scenario, include what data could potentially be affected and in what way + +
+
+
+ + + + + +
+
+ +
+
+
+ + + + + +
+
+ +
+
+
+ +
+
+ +
+ + + + + +
+ + +
+ + + +
+

Need help?

+ + +
+
-
+ + + \ No newline at end of file From b9a133d63a2195c237c76a710924f266a4fea590 Mon Sep 17 00:00:00 2001 From: Per Ploug Date: Fri, 18 Oct 2019 17:04:34 +0200 Subject: [PATCH 6/7] current state of the risk UI WIP Signed-off-by: Per Ploug --- lib/app/assessment.js | 70 +++--- lib/app/assessment.js.map | 2 +- public/components.js | 23 +- public/data.js | 11 + public/risk.js | 444 +++++++++++++++++++++----------------- views/risky.hbs | 115 +++++++--- 6 files changed, 398 insertions(+), 267 deletions(-) diff --git a/lib/app/assessment.js b/lib/app/assessment.js index 0823ee0..8fcf0c3 100644 --- a/lib/app/assessment.js +++ b/lib/app/assessment.js @@ -55,6 +55,22 @@ var ghe_host = process.env.GHE_HOST; var rr_branch = "rapid-risk"; //const master_branch = "master"; var rr_file = "risks.md"; +function ensureBranch(branch) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); +} +function createOrUpdatePr(branch, risks) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + // get all PRs from rapid-risk branch + // create or update PR with correct desription. + return [2 /*return*/, { data: "meh" }]; + }); + }); +} function getRiskFile(octokit, repo, branch) { if (branch === void 0) { branch = ''; } return __awaiter(this, void 0, void 0, function () { @@ -108,52 +124,46 @@ function updateRiskFile(content, sha, octokit, repo, branch) { ; function postAssessment(req, res) { return __awaiter(this, void 0, void 0, function () { - var octokit, gh_repo, branched_riskFile, result, err_1; + var octokit, gh_repo, branched_riskFile, pr, err_1; return __generator(this, function (_a) { switch (_a.label) { case 0: - if (!(req.session && ghe_host)) return [3 /*break*/, 7]; + if (!(req.session && ghe_host)) return [3 /*break*/, 11]; _a.label = 1; case 1: - _a.trys.push([1, 5, , 6]); + _a.trys.push([1, 9, , 10]); octokit = octokit_1.getOctokit(ghe_host, req.session.token); gh_repo = { owner: req.params.owner, repo: req.params.repo }; return [4 /*yield*/, getRiskFile(octokit, gh_repo, rr_branch)]; case 2: branched_riskFile = _a.sent(); - if (!branched_riskFile) return [3 /*break*/, 4]; - return [4 /*yield*/, updateRiskFile(req.body, branched_riskFile.sha, octokit, gh_repo, rr_branch)]; + if (!!branched_riskFile) return [3 /*break*/, 5]; + return [4 /*yield*/, ensureBranch(rr_branch)]; case 3: - result = _a.sent(); - if (!result) { - res.status(500); - } - return [3 /*break*/, 4]; + _a.sent(); + return [4 /*yield*/, updateRiskFile(req.body, "null", octokit, gh_repo, rr_branch)]; case 4: - // ensure PR is open - // update descripting with stats - /* if branch already exists - if(prs.data.length > 0){ - const riskFile = await octokit.repos.getContents({ path: "risks.md", ...gh_repo, ref: rr_branch }); - const sha = riskFile.data.sha; - const content = Buffer.from(YAML.stringify(req.body)).toString('base64'); - await octokit.repos.updateFile({...gh_repo, path: "risks.md", sha: sha, content: content, message: "updated risk file", branch: "rapid-risk"}); - }else{ - - }*/ - //update the file - res.sendStatus(200); - return [3 /*break*/, 6]; - case 5: + _a.sent(); + return [3 /*break*/, 7]; + case 5: return [4 /*yield*/, updateRiskFile(req.body, branched_riskFile.sha, octokit, gh_repo, rr_branch)]; + case 6: + _a.sent(); + _a.label = 7; + case 7: return [4 /*yield*/, createOrUpdatePr(rr_branch, req.body)]; + case 8: + pr = _a.sent(); + res.sendStatus(200).send(pr.data); + return [3 /*break*/, 10]; + case 9: err_1 = _a.sent(); // It threw an error so they can't see the repo res.send(err_1); - return [3 /*break*/, 6]; - case 6: return [3 /*break*/, 8]; - case 7: + return [3 /*break*/, 10]; + case 10: return [3 /*break*/, 12]; + case 11: res.send("no session"); - _a.label = 8; - case 8: return [2 /*return*/]; + _a.label = 12; + case 12: return [2 /*return*/]; } }); }); diff --git a/lib/app/assessment.js.map b/lib/app/assessment.js.map index f7f0132..b64b6df 100644 --- a/lib/app/assessment.js.map +++ b/lib/app/assessment.js.map @@ -1 +1 @@ -{"version":3,"file":"assessment.js","sourceRoot":"","sources":["../../src/app/assessment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAuC;AAEvC,YAAY;AACZ,0CAA6C;AAE7C,YAAY;AACZ,kCAAqC;AAGrC,IAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AACtC,IAAM,SAAS,GAAG,YAAY,CAAC;AAC/B,iCAAiC;AACjC,IAAM,OAAO,GAAG,UAAU,CAAC;AAE3B,SAAe,WAAW,CAAC,OAAmB,EAAE,IAAoC,EAAE,MAAoB;IAApB,uBAAA,EAAA,WAAoB;;;;;;;oBAElG,GAAG,cAAK,IAAI,EAAE,OAAO,IAAK,IAAI,CAAE,CAAC;oBACrC,IAAG,MAAM,KAAK,EAAE,EAAC;wBACf,YAAY;wBACZ,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC;qBAClB;oBAGc,qBAAM,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,EAAA;;oBAA/C,QAAQ,GAAG,SAAoC;oBACnD,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AAC,YAAY,CAAC,CAAC;;;;;;CAE1B;AAnCD,sCAmCC;AAAA,CAAC;AAEF,SAAsB,KAAK,CAAC,GAAa,EAAE,GAAc;;;;;;yBAEpD,CAAA,GAAG,CAAC,OAAO,IAAI,QAAQ,CAAA,EAAvB,wBAAuB;oBAElB,OAAO,GAAG,oBAAU,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBAGhD,OAAO,GAAG,EAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;;;;oBAGrD,qBAAM,OAAO,CAAC,KAAK,CAAC,GAAG,cAAK,OAAO,EAAE,EAAA;;oBAA5C,IAAI,GAAG,SAAqC;oBAChD,GAAG,CAAC,MAAM,CAAC,0BAA0B,EAAE,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC;;;;oBAE1D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAE,CAAC,CAAC;;;;oBAG7B,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;;;;;;CAE1B;AAlBD,sBAkBC"} \ No newline at end of file diff --git a/public/components.js b/public/components.js index 675ac4d..911f1e2 100644 --- a/public/components.js +++ b/public/components.js @@ -98,6 +98,17 @@ Vue.component("menu-overlay", {
+ + {{display}} @@ -105,14 +116,7 @@ Vue.component("menu-overlay", { - +
@@ -173,7 +177,8 @@ Vue.component("dialog-overlay", {
- @@ -261,30 +264,24 @@
+
${outcome.description}
+ -
- -
- -
- -
- - -
-
- - -
-
+
+ +   ${outcome.impact} ${outcome.type} impact +
+
+ +
@@ -335,21 +332,36 @@ -
-
+ + + + + - + -
@@ -365,9 +377,10 @@ + Describe your scenario, include what data could potentially be affected and in what way
@@ -433,11 +446,52 @@ + +
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
+ + + +
@@ -455,7 +509,12 @@
- + + + \ No newline at end of file From f7de99c5b2569f88b7188202e250a9322377a72d Mon Sep 17 00:00:00 2001 From: Per Ploug Date: Mon, 21 Oct 2019 15:53:06 +0200 Subject: [PATCH 7/7] clean up Signed-off-by: Per Ploug --- .gitignore | 4 +- lib/app/assessment.d.ts | 4 - lib/app/assessment.js | 255 ----------------- lib/app/assessment.js.map | 1 - lib/app/issues.d.ts | 3 - lib/app/issues.js | 116 -------- lib/app/issues.js.map | 1 - lib/app/oauth.d.ts | 3 - lib/app/oauth.js | 105 ------- lib/app/oauth.js.map | 1 - lib/app/octokit.d.ts | 2 - lib/app/octokit.js | 18 -- lib/app/octokit.js.map | 1 - lib/app/pullrequest.d.ts | 2 - lib/app/pullrequest.js | 68 ----- lib/app/pullrequest.js.map | 1 - lib/auth/oauth.d.ts | 2 - lib/auth/oauth.js | 89 ------ lib/auth/oauth.js.map | 1 - lib/config.d.ts | 45 --- lib/config.js | 53 ---- lib/config.js.map | 1 - lib/config/app.d.ts | 6 - lib/config/app.js | 79 ------ lib/config/app.js.map | 1 - lib/config/licensetypes.d.ts | 4 - lib/config/licensetypes.js | 111 -------- lib/config/licensetypes.js.map | 1 - lib/config/tasks.d.ts | 3 - lib/config/tasks.js | 62 ----- lib/config/tasks.js.map | 1 - lib/index.d.ts | 3 - lib/index.js | 99 ------- lib/index.js.map | 1 - lib/interfaces/IconEnum.d.ts | 5 - lib/interfaces/IconEnum.js | 3 - lib/interfaces/IconEnum.js.map | 1 - lib/interfaces/StatusEnum.d.ts | 5 - lib/interfaces/StatusEnum.js | 3 - lib/interfaces/StatusEnum.js.map | 1 - lib/interfaces/config/iappconfig.d.ts | 7 - lib/interfaces/config/iappconfig.js | 3 - lib/interfaces/config/iappconfig.js.map | 1 - lib/interfaces/config/iapprovalsconfig.d.ts | 5 - lib/interfaces/config/iapprovalsconfig.js | 3 - lib/interfaces/config/iapprovalsconfig.js.map | 1 - .../config/ilargecommitsconfig.d.ts | 4 - lib/interfaces/config/ilargecommitsconfig.js | 3 - .../config/ilargecommitsconfig.js.map | 1 - lib/interfaces/config/ilicenseconfig.d.ts | 10 - lib/interfaces/config/ilicenseconfig.js | 3 - lib/interfaces/config/ilicenseconfig.js.map | 1 - lib/interfaces/config/ilicensetypes.d.ts | 8 - lib/interfaces/config/ilicensetypes.js | 3 - lib/interfaces/config/ilicensetypes.js.map | 1 - lib/interfaces/config/irisksconfig.d.ts | 6 - lib/interfaces/config/irisksconfig.js | 3 - lib/interfaces/config/irisksconfig.js.map | 1 - .../config/ispecificationconfig.d.ts | 20 -- lib/interfaces/config/ispecificationconfig.js | 3 - .../config/ispecificationconfig.js.map | 1 - lib/interfaces/config/itaskconfig.d.ts | 14 - lib/interfaces/config/itaskconfig.js | 3 - lib/interfaces/config/itaskconfig.js.map | 1 - lib/interfaces/imoduleconstructor.d.ts | 4 - lib/interfaces/imoduleconstructor.js | 3 - lib/interfaces/imoduleconstructor.js.map | 1 - lib/interfaces/iresult.d.ts | 8 - lib/interfaces/iresult.js | 3 - lib/interfaces/iresult.js.map | 1 - lib/interfaces/iresultsummary.d.ts | 6 - lib/interfaces/iresultsummary.js | 3 - lib/interfaces/iresultsummary.js.map | 1 - lib/interfaces/itask.d.ts | 13 - lib/interfaces/itask.js | 3 - lib/interfaces/itask.js.map | 1 - lib/interfaces/itaskparams.d.ts | 10 - lib/interfaces/itaskparams.js | 3 - lib/interfaces/itaskparams.js.map | 1 - lib/interfaces/itaskrunnerparams.d.ts | 11 - lib/interfaces/itaskrunnerparams.js | 3 - lib/interfaces/itaskrunnerparams.js.map | 1 - lib/interfaces/itaskrunnerresult.d.ts | 6 - lib/interfaces/itaskrunnerresult.js | 3 - lib/interfaces/itaskrunnerresult.js.map | 1 - lib/interfaces/params/iappparams.d.ts | 11 - lib/interfaces/params/iappparams.js | 3 - lib/interfaces/params/iappparams.js.map | 1 - lib/interfaces/params/itaskparams.d.ts | 10 - lib/interfaces/params/itaskparams.js | 3 - lib/interfaces/params/itaskparams.js.map | 1 - lib/interfaces/params/itaskrunnerparams.d.ts | 3 - lib/interfaces/params/itaskrunnerparams.js | 3 - .../params/itaskrunnerparams.js.map | 1 - lib/license/lookup.d.ts | 21 -- lib/license/lookup.js | 238 ---------------- lib/license/lookup.js.map | 1 - lib/plural.d.ts | 1 - lib/plural.js | 13 - lib/plural.js.map | 1 - lib/pull-request-change.d.ts | 1 - lib/pull-request-change.js | 166 ------------ lib/pull-request-change.js.map | 1 - lib/repository-added.d.ts | 3 - lib/repository-added.js | 97 ------- lib/repository-added.js.map | 1 - lib/set-status-pass.d.ts | 1 - lib/set-status-pass.js | 70 ----- lib/set-status-pass.js.map | 1 - lib/task-runner.d.ts | 19 -- lib/task-runner.js | 132 --------- lib/task-runner.js.map | 1 - lib/tasks/approvals.d.ts | 16 -- lib/tasks/approvals.js | 256 ------------------ lib/tasks/approvals.js.map | 1 - lib/tasks/base.d.ts | 31 --- lib/tasks/base.js | 133 --------- lib/tasks/base.js.map | 1 - lib/tasks/foureyeprinciple.d.ts | 8 - lib/tasks/foureyeprinciple.js | 147 ---------- lib/tasks/foureyeprinciple.js.map | 1 - lib/tasks/largecommits.d.ts | 11 - lib/tasks/largecommits.js | 139 ---------- lib/tasks/largecommits.js.map | 1 - lib/tasks/license.d.ts | 9 - lib/tasks/license.js | 100 ------- lib/tasks/license.js.map | 1 - lib/tasks/risks.d.ts | 8 - lib/tasks/risks.js | 103 ------- lib/tasks/risks.js.map | 1 - lib/tasks/specification.d.ts | 8 - lib/tasks/specification.js | 117 -------- lib/tasks/specification.js.map | 1 - lib/zincr.d.ts | 18 -- lib/zincr.js | 194 ------------- lib/zincr.js.map | 1 - package-lock.json | 2 +- package.json | 2 +- 138 files changed, 5 insertions(+), 3466 deletions(-) delete mode 100644 lib/app/assessment.d.ts delete mode 100644 lib/app/assessment.js delete mode 100644 lib/app/assessment.js.map delete mode 100644 lib/app/issues.d.ts delete mode 100644 lib/app/issues.js delete mode 100644 lib/app/issues.js.map delete mode 100644 lib/app/oauth.d.ts delete mode 100644 lib/app/oauth.js delete mode 100644 lib/app/oauth.js.map delete mode 100644 lib/app/octokit.d.ts delete mode 100644 lib/app/octokit.js delete mode 100644 lib/app/octokit.js.map delete mode 100644 lib/app/pullrequest.d.ts delete mode 100644 lib/app/pullrequest.js delete mode 100644 lib/app/pullrequest.js.map delete mode 100644 lib/auth/oauth.d.ts delete mode 100644 lib/auth/oauth.js delete mode 100644 lib/auth/oauth.js.map delete mode 100644 lib/config.d.ts delete mode 100644 lib/config.js delete mode 100644 lib/config.js.map delete mode 100644 lib/config/app.d.ts delete mode 100644 lib/config/app.js delete mode 100644 lib/config/app.js.map delete mode 100644 lib/config/licensetypes.d.ts delete mode 100644 lib/config/licensetypes.js delete mode 100644 lib/config/licensetypes.js.map delete mode 100644 lib/config/tasks.d.ts delete mode 100644 lib/config/tasks.js delete mode 100644 lib/config/tasks.js.map delete mode 100644 lib/index.d.ts delete mode 100644 lib/index.js delete mode 100644 lib/index.js.map delete mode 100644 lib/interfaces/IconEnum.d.ts delete mode 100644 lib/interfaces/IconEnum.js delete mode 100644 lib/interfaces/IconEnum.js.map delete mode 100644 lib/interfaces/StatusEnum.d.ts delete mode 100644 lib/interfaces/StatusEnum.js delete mode 100644 lib/interfaces/StatusEnum.js.map delete mode 100644 lib/interfaces/config/iappconfig.d.ts delete mode 100644 lib/interfaces/config/iappconfig.js delete mode 100644 lib/interfaces/config/iappconfig.js.map delete mode 100644 lib/interfaces/config/iapprovalsconfig.d.ts delete mode 100644 lib/interfaces/config/iapprovalsconfig.js delete mode 100644 lib/interfaces/config/iapprovalsconfig.js.map delete mode 100644 lib/interfaces/config/ilargecommitsconfig.d.ts delete mode 100644 lib/interfaces/config/ilargecommitsconfig.js delete mode 100644 lib/interfaces/config/ilargecommitsconfig.js.map delete mode 100644 lib/interfaces/config/ilicenseconfig.d.ts delete mode 100644 lib/interfaces/config/ilicenseconfig.js delete mode 100644 lib/interfaces/config/ilicenseconfig.js.map delete mode 100644 lib/interfaces/config/ilicensetypes.d.ts delete mode 100644 lib/interfaces/config/ilicensetypes.js delete mode 100644 lib/interfaces/config/ilicensetypes.js.map delete mode 100644 lib/interfaces/config/irisksconfig.d.ts delete mode 100644 lib/interfaces/config/irisksconfig.js delete mode 100644 lib/interfaces/config/irisksconfig.js.map delete mode 100644 lib/interfaces/config/ispecificationconfig.d.ts delete mode 100644 lib/interfaces/config/ispecificationconfig.js delete mode 100644 lib/interfaces/config/ispecificationconfig.js.map delete mode 100644 lib/interfaces/config/itaskconfig.d.ts delete mode 100644 lib/interfaces/config/itaskconfig.js delete mode 100644 lib/interfaces/config/itaskconfig.js.map delete mode 100644 lib/interfaces/imoduleconstructor.d.ts delete mode 100644 lib/interfaces/imoduleconstructor.js delete mode 100644 lib/interfaces/imoduleconstructor.js.map delete mode 100644 lib/interfaces/iresult.d.ts delete mode 100644 lib/interfaces/iresult.js delete mode 100644 lib/interfaces/iresult.js.map delete mode 100644 lib/interfaces/iresultsummary.d.ts delete mode 100644 lib/interfaces/iresultsummary.js delete mode 100644 lib/interfaces/iresultsummary.js.map delete mode 100644 lib/interfaces/itask.d.ts delete mode 100644 lib/interfaces/itask.js delete mode 100644 lib/interfaces/itask.js.map delete mode 100644 lib/interfaces/itaskparams.d.ts delete mode 100644 lib/interfaces/itaskparams.js delete mode 100644 lib/interfaces/itaskparams.js.map delete mode 100644 lib/interfaces/itaskrunnerparams.d.ts delete mode 100644 lib/interfaces/itaskrunnerparams.js delete mode 100644 lib/interfaces/itaskrunnerparams.js.map delete mode 100644 lib/interfaces/itaskrunnerresult.d.ts delete mode 100644 lib/interfaces/itaskrunnerresult.js delete mode 100644 lib/interfaces/itaskrunnerresult.js.map delete mode 100644 lib/interfaces/params/iappparams.d.ts delete mode 100644 lib/interfaces/params/iappparams.js delete mode 100644 lib/interfaces/params/iappparams.js.map delete mode 100644 lib/interfaces/params/itaskparams.d.ts delete mode 100644 lib/interfaces/params/itaskparams.js delete mode 100644 lib/interfaces/params/itaskparams.js.map delete mode 100644 lib/interfaces/params/itaskrunnerparams.d.ts delete mode 100644 lib/interfaces/params/itaskrunnerparams.js delete mode 100644 lib/interfaces/params/itaskrunnerparams.js.map delete mode 100644 lib/license/lookup.d.ts delete mode 100644 lib/license/lookup.js delete mode 100644 lib/license/lookup.js.map delete mode 100644 lib/plural.d.ts delete mode 100644 lib/plural.js delete mode 100644 lib/plural.js.map delete mode 100644 lib/pull-request-change.d.ts delete mode 100644 lib/pull-request-change.js delete mode 100644 lib/pull-request-change.js.map delete mode 100644 lib/repository-added.d.ts delete mode 100644 lib/repository-added.js delete mode 100644 lib/repository-added.js.map delete mode 100644 lib/set-status-pass.d.ts delete mode 100644 lib/set-status-pass.js delete mode 100644 lib/set-status-pass.js.map delete mode 100644 lib/task-runner.d.ts delete mode 100644 lib/task-runner.js delete mode 100644 lib/task-runner.js.map delete mode 100644 lib/tasks/approvals.d.ts delete mode 100644 lib/tasks/approvals.js delete mode 100644 lib/tasks/approvals.js.map delete mode 100644 lib/tasks/base.d.ts delete mode 100644 lib/tasks/base.js delete mode 100644 lib/tasks/base.js.map delete mode 100644 lib/tasks/foureyeprinciple.d.ts delete mode 100644 lib/tasks/foureyeprinciple.js delete mode 100644 lib/tasks/foureyeprinciple.js.map delete mode 100644 lib/tasks/largecommits.d.ts delete mode 100644 lib/tasks/largecommits.js delete mode 100644 lib/tasks/largecommits.js.map delete mode 100644 lib/tasks/license.d.ts delete mode 100644 lib/tasks/license.js delete mode 100644 lib/tasks/license.js.map delete mode 100644 lib/tasks/risks.d.ts delete mode 100644 lib/tasks/risks.js delete mode 100644 lib/tasks/risks.js.map delete mode 100644 lib/tasks/specification.d.ts delete mode 100644 lib/tasks/specification.js delete mode 100644 lib/tasks/specification.js.map delete mode 100644 lib/zincr.d.ts delete mode 100644 lib/zincr.js delete mode 100644 lib/zincr.js.map diff --git a/.gitignore b/.gitignore index bc77acb..30a22f4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ .env *.sh node_modules -.nyc_output \ No newline at end of file +.nyc_output + +/lib \ No newline at end of file diff --git a/lib/app/assessment.d.ts b/lib/app/assessment.d.ts deleted file mode 100644 index 0c4ef6d..0000000 --- a/lib/app/assessment.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Request, Response } from "express"; -export declare function postAssessment(req: Request, res: Response): Promise; -export declare function getAssessment(req: Request, res: Response): Promise; -export declare function getUi(req: Request, res: Response): Promise; diff --git a/lib/app/assessment.js b/lib/app/assessment.js deleted file mode 100644 index 8fcf0c3..0000000 --- a/lib/app/assessment.js +++ /dev/null @@ -1,255 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var octokit_1 = require("./octokit"); -//@ts-ignore -var YAML = require("json-to-pretty-yaml"); -//@ts-ignore -var yamltojs = require("js-yaml"); -var ghe_host = process.env.GHE_HOST; -var rr_branch = "rapid-risk"; -//const master_branch = "master"; -var rr_file = "risks.md"; -function ensureBranch(branch) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/]; - }); - }); -} -function createOrUpdatePr(branch, risks) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - // get all PRs from rapid-risk branch - // create or update PR with correct desription. - return [2 /*return*/, { data: "meh" }]; - }); - }); -} -function getRiskFile(octokit, repo, branch) { - if (branch === void 0) { branch = ''; } - return __awaiter(this, void 0, void 0, function () { - var req, response, ex_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - req = __assign({ path: rr_file }, repo); - if (branch !== '') { - //@ts-ignore - req.ref = branch; - } - return [4 /*yield*/, octokit.repos.getContents(req)]; - case 1: - response = _a.sent(); - if (response.status === 200) { - return [2 /*return*/, response.data]; - } - return [3 /*break*/, 3]; - case 2: - ex_1 = _a.sent(); - console.log(ex_1); - return [2 /*return*/, null]; - case 3: return [2 /*return*/]; - } - }); - }); -} -; -function updateRiskFile(content, sha, octokit, repo, branch) { - return __awaiter(this, void 0, void 0, function () { - var yaml, ex_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - yaml = Buffer.from(YAML.stringify(content)).toString('base64'); - return [4 /*yield*/, octokit.repos.updateFile(__assign({}, repo, { path: rr_file, sha: sha, content: yaml, message: "updated risk file", branch: branch }))]; - case 1: - _a.sent(); - return [2 /*return*/, true]; - case 2: - ex_2 = _a.sent(); - return [2 /*return*/, false]; - case 3: return [2 /*return*/]; - } - }); - }); -} -; -function postAssessment(req, res) { - return __awaiter(this, void 0, void 0, function () { - var octokit, gh_repo, branched_riskFile, pr, err_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(req.session && ghe_host)) return [3 /*break*/, 11]; - _a.label = 1; - case 1: - _a.trys.push([1, 9, , 10]); - octokit = octokit_1.getOctokit(ghe_host, req.session.token); - gh_repo = { owner: req.params.owner, repo: req.params.repo }; - return [4 /*yield*/, getRiskFile(octokit, gh_repo, rr_branch)]; - case 2: - branched_riskFile = _a.sent(); - if (!!branched_riskFile) return [3 /*break*/, 5]; - return [4 /*yield*/, ensureBranch(rr_branch)]; - case 3: - _a.sent(); - return [4 /*yield*/, updateRiskFile(req.body, "null", octokit, gh_repo, rr_branch)]; - case 4: - _a.sent(); - return [3 /*break*/, 7]; - case 5: return [4 /*yield*/, updateRiskFile(req.body, branched_riskFile.sha, octokit, gh_repo, rr_branch)]; - case 6: - _a.sent(); - _a.label = 7; - case 7: return [4 /*yield*/, createOrUpdatePr(rr_branch, req.body)]; - case 8: - pr = _a.sent(); - res.sendStatus(200).send(pr.data); - return [3 /*break*/, 10]; - case 9: - err_1 = _a.sent(); - // It threw an error so they can't see the repo - res.send(err_1); - return [3 /*break*/, 10]; - case 10: return [3 /*break*/, 12]; - case 11: - res.send("no session"); - _a.label = 12; - case 12: return [2 /*return*/]; - } - }); - }); -} -exports.postAssessment = postAssessment; -; -function getAssessment(req, res) { - return __awaiter(this, void 0, void 0, function () { - var octokit, gh_repo, riskFile, content, ex_3, err_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(req.session && ghe_host)) return [3 /*break*/, 10]; - _a.label = 1; - case 1: - _a.trys.push([1, 8, , 9]); - octokit = octokit_1.getOctokit(ghe_host, req.session.token); - gh_repo = { owner: req.params.owner, repo: req.params.repo }; - _a.label = 2; - case 2: - _a.trys.push([2, 6, , 7]); - return [4 /*yield*/, getRiskFile(octokit, gh_repo, rr_branch)]; - case 3: - riskFile = _a.sent(); - if (!!riskFile) return [3 /*break*/, 5]; - return [4 /*yield*/, getRiskFile(octokit, gh_repo)]; - case 4: - riskFile = _a.sent(); - _a.label = 5; - case 5: - if (!riskFile) { - riskFile = {}; - } - content = yamltojs.safeLoad(new Buffer(riskFile.content, 'base64').toString('ascii')); - res.status(200).send(content); - return [3 /*break*/, 7]; - case 6: - ex_3 = _a.sent(); - res.status(500).send(ex_3); - return [3 /*break*/, 7]; - case 7: return [3 /*break*/, 9]; - case 8: - err_2 = _a.sent(); - // It threw an error so they can't see the repo - res.status(500).send(err_2); - return [3 /*break*/, 9]; - case 9: return [3 /*break*/, 11]; - case 10: - res.send("no session"); - _a.label = 11; - case 11: return [2 /*return*/]; - } - }); - }); -} -exports.getAssessment = getAssessment; -; -function getUi(req, res) { - return __awaiter(this, void 0, void 0, function () { - var octokit, gh_repo, repo, ex_4; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(req.session && ghe_host)) return [3 /*break*/, 5]; - octokit = octokit_1.getOctokit(ghe_host, req.session.token); - gh_repo = { owner: req.params.owner, repo: req.params.repo }; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, octokit.repos.get(__assign({}, gh_repo))]; - case 2: - repo = _a.sent(); - res.render("../../../views/risky.hbs", { repo: repo.data }); - return [3 /*break*/, 4]; - case 3: - ex_4 = _a.sent(); - res.status(500).send(ex_4); - return [3 /*break*/, 4]; - case 4: return [3 /*break*/, 6]; - case 5: - res.send("no session"); - _a.label = 6; - case 6: return [2 /*return*/]; - } - }); - }); -} -exports.getUi = getUi; -//# sourceMappingURL=assessment.js.map \ No newline at end of file diff --git a/lib/app/assessment.js.map b/lib/app/assessment.js.map deleted file mode 100644 index b64b6df..0000000 --- a/lib/app/assessment.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"assessment.js","sourceRoot":"","sources":["../../src/app/assessment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAuC;AAEvC,YAAY;AACZ,0CAA6C;AAE7C,YAAY;AACZ,kCAAqC;AAGrC,IAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AACtC,IAAM,SAAS,GAAG,YAAY,CAAC;AAC/B,iCAAiC;AACjC,IAAM,OAAO,GAAG,UAAU,CAAC;AAE3B,SAAe,YAAY,CAAC,MAAe;;;;;;CAG1C;AAED,SAAe,gBAAgB,CAAC,MAAe,EAAE,KAAU;;;YACzD,qCAAqC;YACrC,+CAA+C;YAE/C,sBAAO,EAAC,IAAI,EAAE,KAAK,EAAC,EAAC;;;CACtB;AAED,SAAe,WAAW,CAAC,OAAmB,EAAE,IAAoC,EAAE,MAAoB;IAApB,uBAAA,EAAA,WAAoB;;;;;;;oBAElG,GAAG,cAAK,IAAI,EAAE,OAAO,IAAK,IAAI,CAAE,CAAC;oBACrC,IAAG,MAAM,KAAK,EAAE,EAAC;wBACf,YAAY;wBACZ,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC;qBAClB;oBAGc,qBAAM,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,EAAA;;oBAA/C,QAAQ,GAAG,SAAoC;oBACnD,IAAG,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAC;wBACzB,sBAAO,QAAQ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lib/app/issues.d.ts deleted file mode 100644 index aff574c..0000000 --- a/lib/app/issues.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Request, Response } from "express"; -export declare function getIssues(req: Request, res: Response): Promise; -export declare function postIssue(req: Request, res: Response): Promise; diff --git a/lib/app/issues.js b/lib/app/issues.js deleted file mode 100644 index fbdc3a8..0000000 --- a/lib/app/issues.js +++ /dev/null @@ -1,116 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var octokit_1 = require("./octokit"); -var ghe_host = process.env.GHE_HOST; -function getIssues(req, res) { - return __awaiter(this, void 0, void 0, function () { - var octokit, gh_repo, issues, ex_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(req.session && ghe_host)) return [3 /*break*/, 5]; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - octokit = octokit_1.getOctokit(ghe_host, req.session.token); - gh_repo = { owner: req.params.owner, repo: req.params.repo }; - return [4 /*yield*/, octokit.issues.listForRepo(__assign({}, gh_repo, { labels: 'risk' }))]; - case 2: - issues = _a.sent(); - ; - res.send(issues.data); - return [3 /*break*/, 4]; - case 3: - ex_1 = _a.sent(); - res.status(500).send(ex_1); - return [3 /*break*/, 4]; - case 4: return [3 /*break*/, 6]; - case 5: - res.send("no session"); - _a.label = 6; - case 6: return [2 /*return*/]; - } - }); - }); -} -exports.getIssues = getIssues; -; -function postIssue(req, res) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (req.session && ghe_host) { - //var octokit = getOctokit(ghe_host, req.session.token); - /* - var ev = req.body; - //ev.datasource - //ev.threats.label - - // how do we construct a fairly generic body here to convey info of threats -> event -> consequeces - var body = { - title: - } - - const gh_repo = {owner: req.params.owner, repo: req.params.repo }; - const issues = await octokit.issues.create({...gh_repo, title}) .listForRepo({...gh_repo, labels: 'risk'});; - res.send(issues.data); - - }catch(ex){ - res.status(500).send(ex); - } - }else{ - res.send("no session"); - }*/ - } - return [2 /*return*/]; - }); - }); -} -exports.postIssue = postIssue; -; -//# sourceMappingURL=issues.js.map \ No newline at end of file diff --git a/lib/app/issues.js.map b/lib/app/issues.js.map deleted file mode 100644 index ebe0a91..0000000 --- a/lib/app/issues.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"issues.js","sourceRoot":"","sources":["../../src/app/issues.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAuC;AAGvC,IAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AAEtC,SAAsB,SAAS,CAAC,GAAa,EAAE,GAAa;;;;;;yBACvD,CAAA,GAAG,CAAC,OAAO,IAAI,QAAQ,CAAA,EAAvB,wBAAuB;;;;oBAGlB,OAAO,GAAG,oBAAU,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBAChD,OAAO,GAAG,EAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;oBACnD,qBAAM,OAAO,CAAC,MAAM,CAAC,WAAW,cAAK,OAAO,IAAE,MAAM,EAAE,MAAM,IAAE,EAAA;;oBAAvE,MAAM,GAAG,SAA8D;oBAAC,CAAC;oBAC/E,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;;;oBAGtB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAE,CAAC,CAAC;;;;oBAG3B,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;;;;;;CAE1B;AAfD,8BAeC;AAAA,CAAC;AAEF,SAAsB,SAAS,CAAC,GAAa,EAAE,GAAa;;;YAC1D,IAAG,GAAG,CAAC,OAAO,IAAI,QAAQ,EAAC;gBAGtB,wDAAwD;gBACxD;;;;;;;;;;;;;;;;;;;eAmBD;aAEJ;;;;CACD;AA3BD,8BA2BC;AAAA,CAAC"} \ No newline at end of file diff --git a/lib/app/oauth.d.ts b/lib/app/oauth.d.ts deleted file mode 100644 index 0f0af93..0000000 --- a/lib/app/oauth.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Router, Request, Response } from "express"; -export declare function oauth(router: Router): void; -export declare function authenticate(req: Request, res: Response, next: Function): Promise; diff --git a/lib/app/oauth.js b/lib/app/oauth.js deleted file mode 100644 index a6f3df5..0000000 --- a/lib/app/oauth.js +++ /dev/null @@ -1,105 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var request = require('request'); -var querystring = require('querystring'); -var promisify = require('util').promisify; -var post = promisify(request.post); -function oauth(router) { - var _this = this; - var gh_host = process.env.GHE_HOST || "github.com"; - router.get('/github/login', function (req, res) { - var protocol = req.headers["x-forwarded-proto"] || req.protocol; - var host = req.headers['x-forwarded-host'] || req.get('host'); - var params = querystring.stringify({ - client_id: process.env.CLIENT_ID, - redirect_uri: protocol + "://" + host + "/github/callback" - }); - var url = "https://" + gh_host + "/login/oauth/authorize?" + params; - //req.log({url}, 'Redirecting to OAuth') - res.redirect(url); - }); - router.get('/github/callback', function (req, res) { return __awaiter(_this, void 0, void 0, function () { - var tokenRes; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, post({ - url: "https://" + gh_host + "/login/oauth/access_token", - form: { - client_id: process.env.CLIENT_ID, - client_secret: process.env.CLIENT_SECRET, - code: req.query.code, - state: req.query.state - }, - json: true - })]; - case 1: - tokenRes = _a.sent(); - if (tokenRes.statusCode === 200) { - if (!req.session) { - req.session = {}; - } - req.session.token = tokenRes.body.access_token; - res.redirect(req.session.redirect || '/'); - } - else { - res.status(500); - res.send('Invalid code'); - } - return [2 /*return*/]; - } - }); - }); }); -} -exports.oauth = oauth; -function authenticate(req, res, next) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!req.session || !req.session.token) { - req.session = {}; - req.session.redirect = req.originalUrl; - res.redirect('/github/login'); - } - else { - next(); - } - return [2 /*return*/]; - }); - }); -} -exports.authenticate = authenticate; -//# sourceMappingURL=oauth.js.map \ No newline at end of file diff --git a/lib/app/oauth.js.map b/lib/app/oauth.js.map deleted file mode 100644 index f7af199..0000000 --- a/lib/app/oauth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../src/app/oauth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAClC,IAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AACnC,IAAA,qCAAS,CAAmB;AACnC,IAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAGpC,SAAgB,KAAK,CAAC,MAAe;IAArC,iBA2CC;IAzCC,IAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,YAAY,CAAC;IAErD,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,UAAC,GAAG,EAAE,GAAG;QACnC,IAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAA;QACjE,IAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAE/D,IAAM,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC;YACnC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS;YAChC,YAAY,EAAK,QAAQ,WAAM,IAAI,qBAAkB;SACtD,CAAC,CAAA;QACF,IAAM,GAAG,GAAG,aAAW,OAAO,+BAA0B,MAAQ,CAAA;QAChE,wCAAwC;QACxC,GAAG,CAAC,QAAQ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,QAAQ,CAAC,eAAe,CAAC,CAAA;aAC9B;iBAAM;gBACL,IAAI,EAAE,CAAA;aACP;;;;CACF;AARD,oCAQC"} \ No newline at end of file diff --git a/lib/app/octokit.d.ts b/lib/app/octokit.d.ts deleted file mode 100644 index 9a7d924..0000000 --- a/lib/app/octokit.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { GitHubAPI } from "probot/lib/github"; -export declare function getOctokit(host: string, token: string): GitHubAPI; diff --git a/lib/app/octokit.js b/lib/app/octokit.js deleted file mode 100644 index c5fe1d1..0000000 --- a/lib/app/octokit.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var github_1 = require("probot/lib/github"); -function getOctokit(host, token) { - var octokit = github_1.GitHubAPI({ - baseUrl: "https://" + host + "/api/v3", - logger: { - debug: function () { }, - info: function () { }, - warn: console.warn, - error: console.error - }, - }); - octokit.authenticate({ type: 'token', token: token }); - return octokit; -} -exports.getOctokit = getOctokit; -//# sourceMappingURL=octokit.js.map \ No newline at end of file diff --git a/lib/app/octokit.js.map b/lib/app/octokit.js.map deleted file mode 100644 index c43a095..0000000 --- a/lib/app/octokit.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"octokit.js","sourceRoot":"","sources":["../../src/app/octokit.ts"],"names":[],"mappings":";;AAAA,4CAA8C;AAE9C,SAAgB,UAAU,CAAC,IAAa,EAAE,KAAc;IACtD,IAAM,OAAO,GAAG,kBAAS,CAAC;QACxB,OAAO,EAAE,aAAW,IAAI,YAAS;QACjC,MAAM,EAAE;YACN,KAAK,EAAE,cAAO,CAAC;YACf,IAAI,EAAE,cAAO,CAAC;YACd,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB;KACF,CAAC,CAAC;IAEH,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC;AACjB,CAAC;AAbD,gCAaC"} \ No newline at end of file diff --git a/lib/app/pullrequest.d.ts b/lib/app/pullrequest.d.ts deleted file mode 100644 index cf67754..0000000 --- a/lib/app/pullrequest.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Context } from "probot"; -export declare function processPullRequest(context: Context): Promise; diff --git a/lib/app/pullrequest.js b/lib/app/pullrequest.js deleted file mode 100644 index 210b794..0000000 --- a/lib/app/pullrequest.js +++ /dev/null @@ -1,68 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var app_1 = require("../config/app"); -var zincr_1 = require("../zincr"); -function processPullRequest(context) { - return __awaiter(this, void 0, void 0, function () { - var params, _a, zincr; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = { - repo: context.repo(), - organization: null - }; - return [4 /*yield*/, app_1.getTasksConfig(context)]; - case 1: - params = (_a.taskconfig = _b.sent(), - _a.appconfig = app_1.AppConfig, - _a); - if (context.payload.repository.organization && context.payload.repository.organization.login) { - params.organization = context.payload.repository.organization.login; - } - zincr = new zincr_1.Zincr(params); - return [4 /*yield*/, zincr.onChange(context)]; - case 2: - _b.sent(); - return [2 /*return*/]; - } - }); - }); -} -exports.processPullRequest = processPullRequest; -//# sourceMappingURL=pullrequest.js.map \ No newline at end of file diff --git a/lib/app/pullrequest.js.map b/lib/app/pullrequest.js.map deleted file mode 100644 index d4d6706..0000000 --- a/lib/app/pullrequest.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pullrequest.js","sourceRoot":"","sources":["../../src/app/pullrequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAA0D;AAC1D,kCAAiC;AAGjC,SAAsB,kBAAkB,CAAC,OAAiB;;;;;;;wBAEtD,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE;wBACpB,YAAY,EAAE,IAAI;;oBACN,qBAAM,oBAAc,CAAC,OAAO,CAAC,EAAA;;oBAHrC,MAAM,IAGV,aAAU,GAAE,SAA6B;wBACzC,YAAS,GAAE,eAAS;2BACrB;oBAED,IAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,EAAC;wBAC1F,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC;qBACrE;oBAEG,KAAK,GAAG,IAAI,aAAK,CAAC,MAAM,CAAC,CAAC;oBAC9B,qBAAM,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAA;;oBAA7B,SAA6B,CAAC;;;;;CAC/B;AAdD,gDAcC"} \ No newline at end of file diff --git a/lib/auth/oauth.d.ts b/lib/auth/oauth.d.ts deleted file mode 100644 index 971784a..0000000 --- a/lib/auth/oauth.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Router } from "express"; -export declare function oauth(router: Router): void; diff --git a/lib/auth/oauth.js b/lib/auth/oauth.js deleted file mode 100644 index 2c20390..0000000 --- a/lib/auth/oauth.js +++ /dev/null @@ -1,89 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var request = require('request'); -var querystring = require('querystring'); -var promisify = require('util').promisify; -var post = promisify(request.post); -function oauth(router) { - var _this = this; - var gh_host = process.env.GHE_HOST || "github.com"; - router.get('/github/login', function (req, res) { - var protocol = req.headers["x-forwarded-proto"] || req.protocol; - var host = req.headers['x-forwarded-host'] || req.get('host'); - var params = querystring.stringify({ - client_id: process.env.CLIENT_ID, - redirect_uri: protocol + "://" + host + "/github/callback" - }); - var url = "https://" + gh_host + "/login/oauth/authorize?" + params; - //req.log({url}, 'Redirecting to OAuth') - res.redirect(url); - }); - router.get('/github/callback', function (req, res) { return __awaiter(_this, void 0, void 0, function () { - var tokenRes; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, post({ - url: "https://" + gh_host + "/login/oauth/access_token", - form: { - client_id: process.env.CLIENT_ID, - client_secret: process.env.CLIENT_SECRET, - code: req.query.code, - state: req.query.state - }, - json: true - })]; - case 1: - tokenRes = _a.sent(); - if (tokenRes.statusCode === 200) { - if (!req.session) { - req.session = {}; - } - req.session.token = tokenRes.body.access_token; - res.redirect(req.session.redirect || '/'); - } - else { - res.status(500); - res.send('Invalid code'); - } - return [2 /*return*/]; - } - }); - }); }); -} -exports.oauth = oauth; -//# sourceMappingURL=oauth.js.map \ No newline at end of file diff --git a/lib/auth/oauth.js.map b/lib/auth/oauth.js.map deleted file mode 100644 index cba23e5..0000000 --- a/lib/auth/oauth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../src/auth/oauth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAClC,IAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AACnC,IAAA,qCAAS,CAAmB;AAEnC,IAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAEpC,SAAgB,KAAK,CAAC,MAAe;IAArC,iBA2CC;IAzCC,IAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,YAAY,CAAC;IAErD,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,UAAC,GAAG,EAAE,GAAG;QACnC,IAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAA;QACjE,IAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAE/D,IAAM,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC;YACnC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS;YAChC,YAAY,EAAK,QAAQ,WAAM,IAAI,qBAAkB;SACtD,CAAC,CAAA;QACF,IAAM,GAAG,GAAG,aAAW,OAAO,+BAA0B,MAAQ,CAAA;QAChE,wCAAwC;QACxC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IACnB,CAAC,CAAC,CAAA;IAEF,MAAM,CAAC,GAAG,CAAC,kBAAkB,EAAE,UAAO,GAAG,EAAE,GAAG;;;;wBAG3B,qBAAM,IAAI,CAAC;wBAC1B,GAAG,EAAE,aAAW,OAAO,8BAA2B;wBAClD,IAAI,EAAE;4BACJ,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS;4BAChC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;4BACxC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI;4BACpB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK;yBACvB;wBACD,IAAI,EAAE,IAAI;qBACX,CAAC,EAAA;;oBATI,QAAQ,GAAG,SASf;oBAEF,IAAI,QAAQ,CAAC,UAAU,KAAK,GAAG,EAAE;wBAC/B,IAAG,CAAC,GAAG,CAAC,OAAO,EAAC;4BACd,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC;yBAClB;wBAED,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAA;wBAC9C,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAA;qBAC1C;yBAAM;wBACL,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;wBACf,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;qBACzB;;;;SACF,CAAC,CAAA;AACJ,CAAC;AA3CD,sBA2CC"} \ No newline at end of file diff --git a/lib/config.d.ts b/lib/config.d.ts deleted file mode 100644 index af64e5a..0000000 --- a/lib/config.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare let Config: { - tasks: { - autobranch: { - pattern: string; - length: number; - }; - approvals: { - minimum: number; - internal: number; - external: number; - }; - commit: { - message: { - patterns: string[]; - }; - }; - specification: { - title: { - "minimum-length": { - length: number; - enabled: boolean; - }; - }; - body: { - "minimum-length": { - length: number; - enabled: boolean; - }; - "contains-url": boolean; - "contains-issue-number": boolean; - }; - template: { - "differs-from-body": boolean; - }; - }; - "pull-request": { - labels: never[]; - additional: boolean; - }; - license: { - enabled: boolean; - }; - }; -}; -export { Config }; diff --git a/lib/config.js b/lib/config.js deleted file mode 100644 index 59b2ff2..0000000 --- a/lib/config.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var Config = { - tasks: { - // Not implemented - autobranch: { - pattern: "{number}-{title}", - length: 60 - }, - approvals: { - // Legacy setting to support as a zappr drop-in replacement - // in case the commit is an employee this includes the employee in the total count - minimum: 2, - // recommended settings - internal: 1, - external: 2 - // there is no org, group or member settings, all this is now controlled by github codeowners and org membership - }, - // not implemented - commit: { - message: { - patterns: ["#[0-9]+"] - } - }, - specification: { - title: { - "minimum-length": { - length: 8, - enabled: true - } - }, - body: { - "minimum-length": { - length: 8, - enabled: true - }, - "contains-url": true, - "contains-issue-number": true - }, - template: { - "differs-from-body": true - } - }, - // not implemented - "pull-request": { - labels: [], - additional: true - }, - license: { enabled: true } - } -}; -exports.Config = Config; -//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/lib/config.js.map b/lib/config.js.map deleted file mode 100644 index 08f1a7c..0000000 --- a/lib/config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;AAAA,IAAI,MAAM,GAAG;IACX,KAAK,EAAE;QACL,kBAAkB;QAClB,UAAU,EAAE;YACV,OAAO,EAAE,kBAAkB;YAC3B,MAAM,EAAE,EAAE;SACX;QAED,SAAS,EAAE;YACT,2DAA2D;YAC3D,kFAAkF;YAClF,OAAO,EAAE,CAAC;YAEV,uBAAuB;YACvB,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,CAAC;YAEX,gHAAgH;SACjH;QAED,kBAAkB;QAClB,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,QAAQ,EAAE,CAAC,SAAS,CAAC;aACtB;SACF;QAED,aAAa,EAAE;YACb,KAAK,EAAE;gBACL,gBAAgB,EAAE;oBAChB,MAAM,EAAE,CAAC;oBACT,OAAO,EAAE,IAAI;iBACd;aACF;YAED,IAAI,EAAE;gBACJ,gBAAgB,EAAE;oBAChB,MAAM,EAAE,CAAC;oBACT,OAAO,EAAE,IAAI;iBACd;gBAED,cAAc,EAAE,IAAI;gBACpB,uBAAuB,EAAE,IAAI;aAC9B;YAED,QAAQ,EAAE;gBACR,mBAAmB,EAAE,IAAI;aAC1B;SACF;QAED,kBAAkB;QAClB,cAAc,EAAE;YACd,MAAM,EAAE,EAAE;YACV,UAAU,EAAE,IAAI;SACjB;QAED,OAAO,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC;KACzB;CACF,CAAC;AAEO,wBAAM"} \ No newline at end of file diff --git a/lib/config/app.d.ts b/lib/config/app.d.ts deleted file mode 100644 index a3659b4..0000000 --- a/lib/config/app.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IAppConfig } from "../interfaces/config/iappconfig"; -import { ITaskConfig } from "../interfaces/config/itaskconfig"; -import { Context } from "probot"; -declare let AppConfig: IAppConfig; -declare function getTasksConfig(context: Context): Promise; -export { AppConfig, getTasksConfig }; diff --git a/lib/config/app.js b/lib/config/app.js deleted file mode 100644 index 4d47eab..0000000 --- a/lib/config/app.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var tasks_1 = require("./tasks"); -var AppConfig = { - appname: "zincr", - checkname: "Zincr-bot", - configfile: ".zincr.yml", - zapprfile: "../.zappr.yml", - tasksdirectory: "./tasks/" -}; -exports.AppConfig = AppConfig; -function getTasksConfig(context) { - return __awaiter(this, void 0, void 0, function () { - var config, zapprConfig; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, context.config(AppConfig.configfile)]; - case 1: - config = _a.sent(); - if (config) - return [2 /*return*/, __assign({}, tasks_1.TaskConfig, config)]; - return [4 /*yield*/, context.config(AppConfig.zapprfile)]; - case 2: - zapprConfig = _a.sent(); - if (zapprConfig) - return [2 /*return*/, __assign({}, tasks_1.TaskConfig, zapprConfig)]; - return [2 /*return*/, tasks_1.TaskConfig]; - } - }); - }); -} -exports.getTasksConfig = getTasksConfig; -//# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/lib/config/app.js.map b/lib/config/app.js.map deleted file mode 100644 index ef63a51..0000000 --- a/lib/config/app.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/config/app.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,iCAAqC;AAGrC,IAAI,SAAS,GAAe;IAC1B,OAAO,EAAG,OAAO;IACjB,SAAS,EAAG,WAAW;IACvB,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,eAAe;IAC1B,cAAc,EAAE,UAAU;CAC3B,CAAC;AAgBO,8BAAS;AAdlB,SAAe,cAAc,CAAC,OAAiB;;;;;wBAC9B,qBAAM,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,EAAA;;oBAAnD,MAAM,GAAG,SAA0C;oBAEvD,IAAG,MAAM;wBACP,mCAAW,kBAAU,EAAK,MAAM,GAAE;oBAElB,qBAAM,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,EAAA;;oBAAvD,WAAW,GAAG,SAAyC;oBAE3D,IAAG,WAAW;wBACZ,mCAAW,kBAAU,EAAK,WAAW,GAAE;oBAEzC,sBAAO,kBAAU,EAAC;;;;CACrB;AAEmB,wCAAc"} \ No newline at end of file diff --git a/lib/config/licensetypes.d.ts b/lib/config/licensetypes.d.ts deleted file mode 100644 index e62b31f..0000000 --- a/lib/config/licensetypes.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ILicenseTypes } from "../interfaces/config/ilicensetypes"; -declare function FindCompatible(baselicense: string): Array; -declare let LicenseTypes: ILicenseTypes; -export { LicenseTypes, FindCompatible }; diff --git a/lib/config/licensetypes.js b/lib/config/licensetypes.js deleted file mode 100644 index 5bbbe92..0000000 --- a/lib/config/licensetypes.js +++ /dev/null @@ -1,111 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// this list is compiled from the excellent Libraries.io project: https://github.com/librariesio/license-compatibility -// unfortunately is ruby-based so could not adopt it as a dependency. -function FindCompatible(baselicense) { - var group = Object.entries(LicenseTypes) - .filter(function (x) { return x[1].indexOf(baselicense) >= 0; })[0][0]; - var allowed = []; - allowed = allowed.concat(LicenseTypes.publicdomain) - .concat(LicenseTypes.permissive); - // find compatible groups - if (group === "publicdomain") { - return allowed; - } - if (group === "permissive" || group === "weakcopyleft") { - return allowed - .concat(LicenseTypes.weakcopyleft); - } - if (group === "strongcopyleft") { - return allowed - .concat(LicenseTypes.strongcopyleft) - .concat(LicenseTypes.weakcopyleft); - } - if (group === "networkcopyleft") { - return allowed - .concat(LicenseTypes.strongcopyleft) - .concat(LicenseTypes.weakcopyleft) - .concat(LicenseTypes.networkcopyleft); - } - return allowed; -} -exports.FindCompatible = FindCompatible; -var LicenseTypes = { - publicdomain: [ - "CC0-1.0", - "PDDL-1.0", - "SAX-PD", - "Unlicense" - ], - permissive: [ - "AFL-1.1", - "AFL-1.2", - "AFL-2.0", - "AFL-2.1", - "AFL-3.0", - "Apache-2.0", - "Artistic-2.0", - "BSD-2-Clause", - "BSD-3-Clause", - "BSD-3-Clause-Attribution", - "BSD-3-Clause-Clear", - "DSDP", - "ECL-2.0", - "ISC", - "MIT", - "WTFPL", - "ZPL-2.1", - "ZPL-1.0", - "ZPL-2.0", - "Python-2.0" - ], - weakcopyleft: [ - "EPL-1.0", - "LGPL-2.0", - "LGPL-2.1", - "LGPL-3.0", - "LGPL-3.0", - "MPL-2.0", - "MPL-1.0", - "MPL-1.1", - "LGPL-2.0+", - "LGPL-2.1+", - "LGPL-3.0+", - "LGPL-2.0-only", - "LGPL-2.1-only", - "LGPL-3.0-only", - "LGPL-3.0-only", - "LGPL-2.0-or-later", - "LGPL-2.1-or-later", - "LGPL-3.0-or-later" - ], - strongcopyleft: [ - "GPL-3.0", - "GPL-3.0-only", - "GPL-2.0", - "GPL-2.0-only", - "GPL-1.0-only", - "GPL-1.0-or-later", - "GPL-2.0-or-later", - "GPL-3.0-or-later", - "MS-RL", - "ODbL-1.0" - ], - networkcopyleft: [ - "AGPL-1.0", - "AGPL-3.0", - "RPL-1.1", - "RPL-1.5", - "OSL-1.0", - "OSL-1.1", - "OSL-2.0", - "OSL-2.1", - "OSL-3.0", - "AGPL-1.0-only", - "AGPL-1.0-or-later", - "AGPL-3.0-only", - "AGPL-3.0-or-later" - ] -}; -exports.LicenseTypes = LicenseTypes; -//# sourceMappingURL=licensetypes.js.map \ No newline at end of file diff --git a/lib/config/licensetypes.js.map b/lib/config/licensetypes.js.map deleted file mode 100644 index fdf17b4..0000000 --- a/lib/config/licensetypes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"licensetypes.js","sourceRoot":"","sources":["../../src/config/licensetypes.ts"],"names":[],"mappings":";;AAEA,sHAAsH;AACtH,sEAAsE;AACtE,SAAS,cAAc,CAAC,WAAoB;IAE3C,IAAI,KAAK,GAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC;SAChC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAA9B,CAA8B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3D,IAAI,OAAO,GAAmB,EAAE,C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,eAAe;QACf,eAAe;QACf,mBAAmB;QACnB,mBAAmB;QACnB,mBAAmB;KACnB;IACD,cAAc,EAAE;QACf,SAAS;QACT,cAAc;QACd,SAAS;QACT,cAAc;QACd,cAAc;QACd,kBAAkB;QAClB,kBAAkB;QAClB,kBAAkB;QAClB,OAAO;QACP,UAAU;KACV;IACD,eAAe,EAAE;QAChB,UAAU;QACV,UAAU;QACV,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,mBAAmB;KACnB;CACD,CAAC;AAEO,oCAAY"} \ No newline at end of file diff --git a/lib/config/tasks.d.ts b/lib/config/tasks.d.ts deleted file mode 100644 index 42473f8..0000000 --- a/lib/config/tasks.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ITaskConfig } from "../interfaces/config/itaskconfig"; -declare let TaskConfig: ITaskConfig; -export { TaskConfig }; diff --git a/lib/config/tasks.js b/lib/config/tasks.js deleted file mode 100644 index 0698a37..0000000 --- a/lib/config/tasks.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var TaskConfig = { - comment: true, - largecommits: { - enabled: true, - maxLines: 100 - }, - approvals: { - includeAuthor: true, - minimum: 2, - enabled: true - }, - risks: { - enabled: true, - tag: "risk", - tracker: "github", - url: "" - }, - specification: { - enabled: true, - title: { - "minimum-length": { - length: 8, - enabled: true - } - }, - body: { - "minimum-length": { - length: 8, - enabled: true - }, - "contains-url": false, - "contains-issue-number": true - }, - template: { - "differs-from-body": true - } - }, - license: { - // By default this only allows licenses which are compatible with MIT and similiar - // modify to suit your needs. - onlyAllow: [ - 'AFL-2.1', 'AFL-3.0', 'APSL-2.0', 'Apache-1.1', 'Apache-2.0', - 'Artistic-1.0', 'Artistic-2.0', 'BSD-2-Clause', 'BSD-3-Clause', 'BSL-1.0', - 'CC-BY-1.0', 'CC-BY-2.0', 'CC-BY-2.5', 'CC-BY-3.0', 'CC-BY-4.0', - 'CC0-1.0', 'CDDL-1.0', 'CDDL-1.1', 'CPL-1.0', 'EPL-1.0', - 'FTL', 'IPL-1.0', 'ISC', 'LGPL-2.0', 'LGPL-2.1', - 'LGPL-3.0', 'LPL-1.02', 'MIT', 'MPL-1.0', 'MPL-1.1', - 'MPL-2.0', 'MS-PL', 'NCSA', 'OpenSSL', 'PHP-3.0', - 'Ruby', 'Unlicense', 'W3C', 'Xnet', 'ZPL-2.0', - 'Zend-2.0', 'Zlib', 'libtiff' - ], - // use a ban approach - exclude: [], - onNolicense: "warning" /* Warning */, - onNotFound: "warning" /* Warning */, - enabled: true - } -}; -exports.TaskConfig = TaskConfig; -//# sourceMappingURL=tasks.js.map \ No newline at end of file diff --git a/lib/config/tasks.js.map b/lib/config/tasks.js.map deleted file mode 100644 index c705484..0000000 --- a/lib/config/tasks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/config/tasks.ts"],"names":[],"mappings":";;AAGA,IAAI,UAAU,GAAiB;IAC3B,OAAO,EAAE,IAAI;IAEb,YAAY,EAAG;QACb,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,GAAG;KACd;IAED,SAAS,EAAE;QACT,aAAa,EAAE,IAAI;QACnB,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,IAAI;KACd;IAED,KAAK,EAAE;QACL,OAAO,EAAE,IAAI;QACb,GAAG,EAAE,MAAM;QACX,OAAO,EAAE,QAAQ;QACjB,GAAG,EAAE,EAAE;KACR;IAED,aAAa,EAAE;QACb,OAAO,EAAE,IAAI;QAEb,KAAK,EAAE;YACL,gBAAgB,EAAE;gBAChB,MAAM,EAAE,CAAC;gBACT,OAAO,EAAE,IAAI;aACd;SACF;QAED,IAAI,EAAE;YACJ,gBAAgB,EAAE;gBAChB,MAAM,EAAE,CAAC;gBACT,OAAO,EAAE,IAAI;aACd;YAED,cAAc,EAAE,KAAK;YACrB,uBAAuB,EAAE,IAAI;SAC9B;QAED,QAAQ,EAAE;YACR,mBAAmB,EAAE,IAAI;SAC1B;KACF;IAED,OAAO,EAAG;QACR,kFAAkF;QAClF,6BAA6B;QAC7B,SAAS,EAAE;YACT,SAAS,EAAO,SAAS,EAAO,UAAU,EAAM,YAAY,EAAI,YAAY;YAC5E,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS;YACzE,WAAW,EAAK,WAAW,EAAK,WAAW,EAAK,WAAW,EAAK,WAAW;YAC3E,SAAS,EAAO,UAAU,EAAM,UAAU,EAAM,SAAS,EAAO,SAAS;YACzE,KAAK,EAAW,SAAS,EAAO,KAAK,EAAW,UAAU,EAAM,UAAU;YAC1E,UAAU,EAAM,UAAU,EAAM,KAAK,EAAW,SAAS,EAAO,SAAS;YACzE,SAAS,EAAO,OAAO,EAAS,MAAM,EAAU,SAAS,EAAO,SAAS;YACzE,MAAM,EAAU,WAAW,EAAK,KAAK,EAAW,MAAM,EAAU,SAAS;YACzE,UAAU,EAAM,MAAM,EAAU,SAAS;SAC1C;QAED,sBAAsB;QACtB,OAAO,EAAE,EAAE;QAEX,WAAW,yBAAoB;QAC/B,UAAU,yBAAoB;QAE9B,OAAO,EAAE,IAAI;KACd;CACJ,CAAC;AAEO,gCAAU"} \ No newline at end of file diff --git a/lib/index.d.ts b/lib/index.d.ts deleted file mode 100644 index 4ce7d46..0000000 --- a/lib/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Application } from "probot"; -declare const _default: (app: Application) => void; -export = _default; diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 0069dca..0000000 --- a/lib/index.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var _this = this; -var cookieSession = require("cookie-session"); -var express = require("express"); -var path = require("path"); -var bodyParser = require("body-parser"); -var oauth_1 = require("./app/oauth"); -// controllers -var assessment_1 = require("./app/assessment"); -var issues_1 = require("./app/issues"); -var pullrequest_1 = require("./app/pullrequest"); -module.exports = function (app) { - // Runs the check on all pull request and review events - var events = ["pull_request", "pull_request_review"]; - app.on(events, pullrequest_1.processPullRequest); - // Router for authenticating against github enterprise - var server = app.route(); - // authentication configuration for github oauth - if (process.env.WEBHOOK_SECRET) { - server.use(cookieSession({ - name: 'session', - keys: [process.env.WEBHOOK_SECRET], - maxAge: 30 * 24 * 60 * 60 * 1000 // 30 days - })); - } - //setup routes for oauth - oauth_1.oauth(server); - // middleware to enforce redirect on missing auth - server.use(function (req, res, next) { return __awaiter(_this, void 0, void 0, function () { - var gh, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!req.session) return [3 /*break*/, 3]; - if (!req.session.token) return [3 /*break*/, 3]; - return [4 /*yield*/, app.auth()]; - case 1: - gh = _b.sent(); - gh.authenticate({ type: 'token', token: req.session.token }); - if (!!req.session.login) return [3 /*break*/, 3]; - _a = req.session; - return [4 /*yield*/, gh.users.getAuthenticated({})]; - case 2: - _a.login = (_b.sent()).data.login; - _b.label = 3; - case 3: - next(); - return [2 /*return*/]; - } - }); - }); }); - // Functionality for risk UI - var zincr_app = app.route("/zincr"); - zincr_app.use(bodyParser.json()); - zincr_app.use('/libs', express.static(path.join(__dirname, '../node_modules'))); - zincr_app.use("/public", express.static(path.join(__dirname, '../public'))); - // routes - zincr_app.post('/risk/:owner/:repo/issue', oauth_1.authenticate, issues_1.postIssue); - zincr_app.get('/risk/:owner/:repo/issues', oauth_1.authenticate, issues_1.getIssues); - zincr_app.post('/risk/:owner/:repo/assessment', oauth_1.authenticate, assessment_1.postAssessment); - zincr_app.get('/risk/:owner/:repo/assessment', oauth_1.authenticate, assessment_1.getAssessment); - zincr_app.get('/risk/:owner/:repo', oauth_1.authenticate, assessment_1.getUi); -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map deleted file mode 100644 index 9ac193f..0000000 --- a/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;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AAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC,EAAA;;oBAAxD,GAAY,KAAK,GAAG,CAAC,SAAmC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA;;;oBAIxE,IAAI,EAAE,CAAA;;;;SACP,CAAC,CAAA;IAEF,4BAA4B;IAC5B,IAAM,SAAS,GAAY,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC/C,SAAS,CAAC,GAAG,CAAE,UAAU,CAAC,IAAI,EAAE,CAAE,CAAC;IACnC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChF,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAE5E,UAAU;IACV,SAAS,CAAC,IAAI,CAAC,0BAA0B,EAAE,oBAAY,EAAE,kBAAS,CAAC,CAAC;IACpE,SAAS,CAAC,GAAG,CAAC,2BAA2B,EAAE,oBAAY,EAAE,kBAAS,CAAE,CAAC;IAErE,SAAS,CAAC,IAAI,CAAC,+BAA+B,EAAE,oBAAY,EAAE,2BAAc,CAAC,CAAC;IAC9E,SAAS,CAAC,GAAG,CAAC,+BAA+B,EAAE,oBAAY,EAAE,0BAAa,CAAC,CAAC;IAC5E,SAAS,CAAC,GAAG,CAAC,oBAAoB,EAAE,oBAAY,EAAE,kBAAK,CAAC,CAAC;AAC3D,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/interfaces/IconEnum.d.ts b/lib/interfaces/IconEnum.d.ts deleted file mode 100644 index 8aa3558..0000000 --- a/lib/interfaces/IconEnum.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const enum IconEnum { - Success = "\u2705", - Warning = "\u2139\uFE0F", - Failure = "\u274C" -} diff --git a/lib/interfaces/IconEnum.js b/lib/interfaces/IconEnum.js deleted file mode 100644 index 4b011eb..0000000 --- a/lib/interfaces/IconEnum.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=IconEnum.js.map \ No newline at end of file diff --git a/lib/interfaces/IconEnum.js.map b/lib/interfaces/IconEnum.js.map deleted file mode 100644 index 1775cee..0000000 --- a/lib/interfaces/IconEnum.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"IconEnum.js","sourceRoot":"","sources":["../../src/interfaces/IconEnum.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/StatusEnum.d.ts b/lib/interfaces/StatusEnum.d.ts deleted file mode 100644 index f4b087f..0000000 --- a/lib/interfaces/StatusEnum.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const enum StatusEnum { - Success = "success", - Warning = "warning", - Failure = "failure" -} diff --git a/lib/interfaces/StatusEnum.js b/lib/interfaces/StatusEnum.js deleted file mode 100644 index f7faea5..0000000 --- a/lib/interfaces/StatusEnum.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=StatusEnum.js.map \ No newline at end of file diff --git a/lib/interfaces/StatusEnum.js.map b/lib/interfaces/StatusEnum.js.map deleted file mode 100644 index d9ec498..0000000 --- a/lib/interfaces/StatusEnum.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"StatusEnum.js","sourceRoot":"","sources":["../../src/interfaces/StatusEnum.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/config/iappconfig.d.ts b/lib/interfaces/config/iappconfig.d.ts deleted file mode 100644 index 681b460..0000000 --- a/lib/interfaces/config/iappconfig.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface IAppConfig { - appname: string; - checkname: string; - configfile: string; - zapprfile: string; - tasksdirectory: string; -} diff --git a/lib/interfaces/config/iappconfig.js b/lib/interfaces/config/iappconfig.js deleted file mode 100644 index 52740e2..0000000 --- a/lib/interfaces/config/iappconfig.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=iappconfig.js.map \ No newline at end of file diff --git a/lib/interfaces/config/iappconfig.js.map b/lib/interfaces/config/iappconfig.js.map deleted file mode 100644 index fa29033..0000000 --- a/lib/interfaces/config/iappconfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iappconfig.js","sourceRoot":"","sources":["../../../src/interfaces/config/iappconfig.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/config/iapprovalsconfig.d.ts b/lib/interfaces/config/iapprovalsconfig.d.ts deleted file mode 100644 index 4f4e672..0000000 --- a/lib/interfaces/config/iapprovalsconfig.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface IApprovalsConfig { - includeAuthor: boolean; - minimum: number; - enabled: boolean; -} diff --git a/lib/interfaces/config/iapprovalsconfig.js b/lib/interfaces/config/iapprovalsconfig.js deleted file mode 100644 index b5d601b..0000000 --- a/lib/interfaces/config/iapprovalsconfig.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=iapprovalsconfig.js.map \ No newline at end of file diff --git a/lib/interfaces/config/iapprovalsconfig.js.map b/lib/interfaces/config/iapprovalsconfig.js.map deleted file mode 100644 index 8e6cb8a..0000000 --- a/lib/interfaces/config/iapprovalsconfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iapprovalsconfig.js","sourceRoot":"","sources":["../../../src/interfaces/config/iapprovalsconfig.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/config/ilargecommitsconfig.d.ts b/lib/interfaces/config/ilargecommitsconfig.d.ts deleted file mode 100644 index 7c1b20d..0000000 --- a/lib/interfaces/config/ilargecommitsconfig.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface ILargeCommitsConfig { - maxLines: number; - enabled: boolean; -} diff --git a/lib/interfaces/config/ilargecommitsconfig.js b/lib/interfaces/config/ilargecommitsconfig.js deleted file mode 100644 index fc3545c..0000000 --- a/lib/interfaces/config/ilargecommitsconfig.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=ilargecommitsconfig.js.map \ No newline at end of file diff --git a/lib/interfaces/config/ilargecommitsconfig.js.map b/lib/interfaces/config/ilargecommitsconfig.js.map deleted file mode 100644 index ebb4500..0000000 --- a/lib/interfaces/config/ilargecommitsconfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ilargecommitsconfig.js","sourceRoot":"","sources":["../../../src/interfaces/config/ilargecommitsconfig.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/config/ilicenseconfig.d.ts b/lib/interfaces/config/ilicenseconfig.d.ts deleted file mode 100644 index 3e8b7ea..0000000 --- a/lib/interfaces/config/ilicenseconfig.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { StatusEnum } from "../StatusEnum"; -export interface ILicenseConfig { - onlyAllow?: string[]; - exclude?: string[]; - whitelist?: string[]; - onNotFound: StatusEnum; - onNolicense: StatusEnum; - enabled: boolean; - baseLicense?: string; -} diff --git a/lib/interfaces/config/ilicenseconfig.js b/lib/interfaces/config/ilicenseconfig.js deleted file mode 100644 index 7875c0e..0000000 --- a/lib/interfaces/config/ilicenseconfig.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=ilicenseconfig.js.map \ No newline at end of file diff --git a/lib/interfaces/config/ilicenseconfig.js.map b/lib/interfaces/config/ilicenseconfig.js.map deleted file mode 100644 index aa9a356..0000000 --- a/lib/interfaces/config/ilicenseconfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ilicenseconfig.js","sourceRoot":"","sources":["../../../src/interfaces/config/ilicenseconfig.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/config/ilicensetypes.d.ts b/lib/interfaces/config/ilicensetypes.d.ts deleted file mode 100644 index e4f8699..0000000 --- a/lib/interfaces/config/ilicensetypes.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface ILicenseTypes { - publicdomain: Array; - permissive: Array; - weakcopyleft: Array; - strongcopyleft: Array; - networkcopyleft: Array; - [key: string]: Array; -} diff --git a/lib/interfaces/config/ilicensetypes.js b/lib/interfaces/config/ilicensetypes.js deleted file mode 100644 index dce377a..0000000 --- a/lib/interfaces/config/ilicensetypes.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=ilicensetypes.js.map \ No newline at end of file diff --git a/lib/interfaces/config/ilicensetypes.js.map b/lib/interfaces/config/ilicensetypes.js.map deleted file mode 100644 index 9076f59..0000000 --- a/lib/interfaces/config/ilicensetypes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ilicensetypes.js","sourceRoot":"","sources":["../../../src/interfaces/config/ilicensetypes.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/config/irisksconfig.d.ts b/lib/interfaces/config/irisksconfig.d.ts deleted file mode 100644 index e183ee4..0000000 --- a/lib/interfaces/config/irisksconfig.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface IRisksConfig { - enabled: boolean; - tag: string; - tracker: string; - url: string; -} diff --git a/lib/interfaces/config/irisksconfig.js b/lib/interfaces/config/irisksconfig.js deleted file mode 100644 index ef09e9c..0000000 --- a/lib/interfaces/config/irisksconfig.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=irisksconfig.js.map \ No newline at end of file diff --git a/lib/interfaces/config/irisksconfig.js.map b/lib/interfaces/config/irisksconfig.js.map deleted file mode 100644 index 37c4b61..0000000 --- a/lib/interfaces/config/irisksconfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"irisksconfig.js","sourceRoot":"","sources":["../../../src/interfaces/config/irisksconfig.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/config/ispecificationconfig.d.ts b/lib/interfaces/config/ispecificationconfig.d.ts deleted file mode 100644 index 820022e..0000000 --- a/lib/interfaces/config/ispecificationconfig.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -export interface ISpecificationConfig { - enabled: boolean; - title: { - "minimum-length": { - length: number; - enabled: boolean; - }; - }; - body: { - "minimum-length": { - length: number; - enabled: boolean; - }; - "contains-url": boolean; - "contains-issue-number": boolean; - }; - template: { - "differs-from-body": boolean; - }; -} diff --git a/lib/interfaces/config/ispecificationconfig.js b/lib/interfaces/config/ispecificationconfig.js deleted file mode 100644 index be1b9e3..0000000 --- a/lib/interfaces/config/ispecificationconfig.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=ispecificationconfig.js.map \ No newline at end of file diff --git a/lib/interfaces/config/ispecificationconfig.js.map b/lib/interfaces/config/ispecificationconfig.js.map deleted file mode 100644 index 6d86317..0000000 --- a/lib/interfaces/config/ispecificationconfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ispecificationconfig.js","sourceRoot":"","sources":["../../../src/interfaces/config/ispecificationconfig.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/config/itaskconfig.d.ts b/lib/interfaces/config/itaskconfig.d.ts deleted file mode 100644 index 1bac341..0000000 --- a/lib/interfaces/config/itaskconfig.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ILicenseConfig } from "./ilicenseconfig"; -import { IApprovalsConfig } from "./iapprovalsconfig"; -import { ISpecificationConfig } from "./ispecificationconfig"; -import { ILargeCommitsConfig } from "./ilargecommitsconfig"; -import { IRisksConfig } from "./irisksconfig"; -export interface ITaskConfig { - comment?: boolean; - license?: ILicenseConfig; - approvals?: IApprovalsConfig; - specification?: ISpecificationConfig; - largecommits?: ILargeCommitsConfig; - risks?: IRisksConfig; - [key: string]: any; -} diff --git a/lib/interfaces/config/itaskconfig.js b/lib/interfaces/config/itaskconfig.js deleted file mode 100644 index 975d8f5..0000000 --- a/lib/interfaces/config/itaskconfig.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=itaskconfig.js.map \ No newline at end of file diff --git a/lib/interfaces/config/itaskconfig.js.map b/lib/interfaces/config/itaskconfig.js.map deleted file mode 100644 index 1308be7..0000000 --- a/lib/interfaces/config/itaskconfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"itaskconfig.js","sourceRoot":"","sources":["../../../src/interfaces/config/itaskconfig.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/imoduleconstructor.d.ts b/lib/interfaces/imoduleconstructor.d.ts deleted file mode 100644 index ffe45c6..0000000 --- a/lib/interfaces/imoduleconstructor.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { BaseTask } from "../tasks/base"; -export interface ModuleConstructor { - new (): T; -} diff --git a/lib/interfaces/imoduleconstructor.js b/lib/interfaces/imoduleconstructor.js deleted file mode 100644 index db1e839..0000000 --- a/lib/interfaces/imoduleconstructor.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=imoduleconstructor.js.map \ No newline at end of file diff --git a/lib/interfaces/imoduleconstructor.js.map b/lib/interfaces/imoduleconstructor.js.map deleted file mode 100644 index 455058c..0000000 --- a/lib/interfaces/imoduleconstructor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"imoduleconstructor.js","sourceRoot":"","sources":["../../src/interfaces/imoduleconstructor.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/iresult.d.ts b/lib/interfaces/iresult.d.ts deleted file mode 100644 index 5bb157e..0000000 --- a/lib/interfaces/iresult.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { StatusEnum } from "./StatusEnum"; -import { IDependencyLookUp } from "license-lookup/lib/interfaces/IDependencyLooKUp"; -export interface IResult { - result: StatusEnum; - label: string; - description?: string; - dependency?: IDependencyLookUp; -} diff --git a/lib/interfaces/iresult.js b/lib/interfaces/iresult.js deleted file mode 100644 index 1a56a46..0000000 --- a/lib/interfaces/iresult.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=iresult.js.map \ No newline at end of file diff --git a/lib/interfaces/iresult.js.map b/lib/interfaces/iresult.js.map deleted file mode 100644 index b1c815a..0000000 --- a/lib/interfaces/iresult.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iresult.js","sourceRoot":"","sources":["../../src/interfaces/iresult.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/iresultsummary.d.ts b/lib/interfaces/iresultsummary.d.ts deleted file mode 100644 index 11e084a..0000000 --- a/lib/interfaces/iresultsummary.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IResult } from "./iresult"; -export interface IResultSummary { - Success: IResult[]; - Failure: IResult[]; - Warning: IResult[]; -} diff --git a/lib/interfaces/iresultsummary.js b/lib/interfaces/iresultsummary.js deleted file mode 100644 index ab1b03d..0000000 --- a/lib/interfaces/iresultsummary.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=iresultsummary.js.map \ No newline at end of file diff --git a/lib/interfaces/iresultsummary.js.map b/lib/interfaces/iresultsummary.js.map deleted file mode 100644 index 65841d8..0000000 --- a/lib/interfaces/iresultsummary.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iresultsummary.js","sourceRoot":"","sources":["../../src/interfaces/iresultsummary.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/itask.d.ts b/lib/interfaces/itask.d.ts deleted file mode 100644 index 76ec4fc..0000000 --- a/lib/interfaces/itask.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Context } from "probot"; -import { IResult } from "./iresult"; -import { IResultSummary } from "./iresultsummary"; -export interface ITask { - name: string; - description: string; - resolution: string; - postAsComment?: boolean; - result?: IResult[]; - summary(): IResultSummary; - render(): string; - run(context: Context, config: any): Promise; -} diff --git a/lib/interfaces/itask.js b/lib/interfaces/itask.js deleted file mode 100644 index 5273a51..0000000 --- a/lib/interfaces/itask.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=itask.js.map \ No newline at end of file diff --git a/lib/interfaces/itask.js.map b/lib/interfaces/itask.js.map deleted file mode 100644 index e77d7b1..0000000 --- a/lib/interfaces/itask.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"itask.js","sourceRoot":"","sources":["../../src/interfaces/itask.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/itaskparams.d.ts b/lib/interfaces/itaskparams.d.ts deleted file mode 100644 index 82a1c64..0000000 --- a/lib/interfaces/itaskparams.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IAppConfig } from "./config/iappconfig"; -export interface ITaskParams { - appconfig: IAppConfig; - config: T; - repo: { - repo: string; - owner: string; - }; - organization: string | null; -} diff --git a/lib/interfaces/itaskparams.js b/lib/interfaces/itaskparams.js deleted file mode 100644 index e8b9a7a..0000000 --- a/lib/interfaces/itaskparams.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=itaskparams.js.map \ No newline at end of file diff --git a/lib/interfaces/itaskparams.js.map b/lib/interfaces/itaskparams.js.map deleted file mode 100644 index 60a3b0c..0000000 --- a/lib/interfaces/itaskparams.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"itaskparams.js","sourceRoot":"","sources":["../../src/interfaces/itaskparams.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/itaskrunnerparams.d.ts b/lib/interfaces/itaskrunnerparams.d.ts deleted file mode 100644 index 6b54495..0000000 --- a/lib/interfaces/itaskrunnerparams.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { IAppConfig } from "./config/iappconfig"; -import { ITaskConfig } from "./config/itaskconfig"; -export interface ITaskRunnerParams { - appconfig: IAppConfig; - taskconfig: ITaskConfig; - repo: { - repo: string; - owner: string; - }; - organization: string | null; -} diff --git a/lib/interfaces/itaskrunnerparams.js b/lib/interfaces/itaskrunnerparams.js deleted file mode 100644 index 452f415..0000000 --- a/lib/interfaces/itaskrunnerparams.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=itaskrunnerparams.js.map \ No newline at end of file diff --git a/lib/interfaces/itaskrunnerparams.js.map b/lib/interfaces/itaskrunnerparams.js.map deleted file mode 100644 index 20e534c..0000000 --- a/lib/interfaces/itaskrunnerparams.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"itaskrunnerparams.js","sourceRoot":"","sources":["../../src/interfaces/itaskrunnerparams.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/itaskrunnerresult.d.ts b/lib/interfaces/itaskrunnerresult.d.ts deleted file mode 100644 index 5eedc12..0000000 --- a/lib/interfaces/itaskrunnerresult.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ITask } from "./itask"; -export interface ITaskRunnerResults { - Success: ITask[]; - Failure: ITask[]; - Warning: ITask[]; -} diff --git a/lib/interfaces/itaskrunnerresult.js b/lib/interfaces/itaskrunnerresult.js deleted file mode 100644 index dc898d0..0000000 --- a/lib/interfaces/itaskrunnerresult.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=itaskrunnerresult.js.map \ No newline at end of file diff --git a/lib/interfaces/itaskrunnerresult.js.map b/lib/interfaces/itaskrunnerresult.js.map deleted file mode 100644 index 5ca531b..0000000 --- a/lib/interfaces/itaskrunnerresult.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"itaskrunnerresult.js","sourceRoot":"","sources":["../../src/interfaces/itaskrunnerresult.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/params/iappparams.d.ts b/lib/interfaces/params/iappparams.d.ts deleted file mode 100644 index 5cd20c0..0000000 --- a/lib/interfaces/params/iappparams.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { IAppConfig } from "../config/iappconfig"; -import { ITaskConfig } from "../config/itaskconfig"; -export interface IAppParams { - appconfig: IAppConfig; - taskconfig: ITaskConfig; - repo: { - repo: string; - owner: string; - }; - organization: string | null; -} diff --git a/lib/interfaces/params/iappparams.js b/lib/interfaces/params/iappparams.js deleted file mode 100644 index ab8b3ac..0000000 --- a/lib/interfaces/params/iappparams.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=iappparams.js.map \ No newline at end of file diff --git a/lib/interfaces/params/iappparams.js.map b/lib/interfaces/params/iappparams.js.map deleted file mode 100644 index d0af772..0000000 --- a/lib/interfaces/params/iappparams.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iappparams.js","sourceRoot":"","sources":["../../../src/interfaces/params/iappparams.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/params/itaskparams.d.ts b/lib/interfaces/params/itaskparams.d.ts deleted file mode 100644 index 71da005..0000000 --- a/lib/interfaces/params/itaskparams.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IAppConfig } from "../config/iappconfig"; -export interface ITaskParams { - appconfig: IAppConfig; - config: T; - repo: { - repo: string; - owner: string; - }; - organization: string | null; -} diff --git a/lib/interfaces/params/itaskparams.js b/lib/interfaces/params/itaskparams.js deleted file mode 100644 index e8b9a7a..0000000 --- a/lib/interfaces/params/itaskparams.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=itaskparams.js.map \ No newline at end of file diff --git a/lib/interfaces/params/itaskparams.js.map b/lib/interfaces/params/itaskparams.js.map deleted file mode 100644 index 8ebed65..0000000 --- a/lib/interfaces/params/itaskparams.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"itaskparams.js","sourceRoot":"","sources":["../../../src/interfaces/params/itaskparams.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/interfaces/params/itaskrunnerparams.d.ts b/lib/interfaces/params/itaskrunnerparams.d.ts deleted file mode 100644 index 32990ef..0000000 --- a/lib/interfaces/params/itaskrunnerparams.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IAppParams } from "./iappparams"; -export interface ITaskRunnerParams extends IAppParams { -} diff --git a/lib/interfaces/params/itaskrunnerparams.js b/lib/interfaces/params/itaskrunnerparams.js deleted file mode 100644 index 452f415..0000000 --- a/lib/interfaces/params/itaskrunnerparams.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=itaskrunnerparams.js.map \ No newline at end of file diff --git a/lib/interfaces/params/itaskrunnerparams.js.map b/lib/interfaces/params/itaskrunnerparams.js.map deleted file mode 100644 index 98829a0..0000000 --- a/lib/interfaces/params/itaskrunnerparams.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"itaskrunnerparams.js","sourceRoot":"","sources":["../../../src/interfaces/params/itaskrunnerparams.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/license/lookup.d.ts b/lib/license/lookup.d.ts deleted file mode 100644 index e0af8fb..0000000 --- a/lib/license/lookup.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Context } from "probot"; -import { ILicenseConfig } from "../interfaces/config/ilicenseconfig"; -import { IResult } from "../interfaces/iresult"; -import { IResultSummary } from "../interfaces/iresultsummary"; -import { PullRequestsGetResponse } from "@octokit/rest"; -export default class Lookup { - result: IResult[]; - private _summary; - private _config; - private _onlyNew; - private _context; - constructor(config: ILicenseConfig, context: Context, onlyNew?: boolean); - private _buildConfig; - private _licenseBanned; - run(repo: { - repo: string; - owner: string; - }, ref?: string, pr?: PullRequestsGetResponse | undefined): Promise>; - summary(): IResultSummary; - render(incudeDescription?: boolean): string; -} diff --git a/lib/license/lookup.js b/lib/license/lookup.js deleted file mode 100644 index eccc8a6..0000000 --- a/lib/license/lookup.js +++ /dev/null @@ -1,238 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var license_lookup_1 = require("license-lookup"); -var licensetypes_1 = require("../config/licensetypes"); -var Lookup = /** @class */ (function () { - function Lookup(config, context, onlyNew) { - if (onlyNew === void 0) { onlyNew = true; } - this.result = new Array(); - this._summary = null; - this._onlyNew = true; - this._onlyNew = onlyNew; - this._config = config; - this._context = context; - this._config.exclude = this._buildConfig(config.exclude, licensetypes_1.LicenseTypes); - if (this._config.baseLicense) { - this._config.onlyAllow = licensetypes_1.FindCompatible(this._config.baseLicense); - } - else { - this._config.onlyAllow = this._buildConfig(config.onlyAllow, licensetypes_1.LicenseTypes); - } - } - Lookup.prototype._buildConfig = function (licenses, licenseTypes) { - if (licenses) { - for (var _i = 0, _a = Object.keys(licenseTypes); _i < _a.length; _i++) { - var group = _a[_i]; - var groupIndex = licenses.indexOf(group); - if (groupIndex >= 0) { - licenses.splice(groupIndex, 1); - licenses.push.apply(licenses, licenseTypes[group.toString()]); - } - } - } - return licenses; - }; - Lookup.prototype._licenseBanned = function (license) { - if (!license) { - return "warning" /* Warning */; - } - if (!this._config) { - return "warning" /* Warning */; - } - if (this._config.exclude && this._config.exclude.length > 0 && this._config.exclude.indexOf(license) >= 0) { - return "failure" /* Failure */; - } - if (this._config.onlyAllow && this._config.onlyAllow.length > 0 && this._config.onlyAllow.indexOf(license) < 0) { - return "failure" /* Failure */; - } - return "warning" /* Warning */; - }; - Lookup.prototype.run = function (repo, ref, pr) { - if (ref === void 0) { ref = 'master'; } - if (pr === void 0) { pr = undefined; } - return __awaiter(this, void 0, void 0, function () { - var files, pr_contents, repo_contens, ll, matches, _i, matches_1, match, deps, head_response, head_content, base, base_response, base_content, base_deps, baseDepsKeys, repo_response, repo_content, deps_lookup, _a, deps_lookup_1, dd, res, ex_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - files = []; - if (!pr) return [3 /*break*/, 2]; - return [4 /*yield*/, this._context.github.pullRequests.listFiles(__assign({}, repo, { number: pr.number }))]; - case 1: - pr_contents = _b.sent(); - files = pr_contents.data.map(function (x) { return x.filename; }); - return [3 /*break*/, 4]; - case 2: return [4 /*yield*/, this._context.github.repos.getContents(__assign({}, repo, { path: "/" }))]; - case 3: - repo_contens = (_b.sent()).data; - files = repo_contens.filter(function (x) { return x.type === "file"; }).map(function (x) { return x.path; }); - _b.label = 4; - case 4: - ll = new license_lookup_1.LicenseLookup(); - matches = ll.matchFilesToManager(files); - if (matches.length == 0) { - return [2 /*return*/, []]; - } - _i = 0, matches_1 = matches; - _b.label = 5; - case 5: - if (!(_i < matches_1.length)) return [3 /*break*/, 19]; - match = matches_1[_i]; - _b.label = 6; - case 6: - _b.trys.push([6, 17, , 18]); - deps = []; - if (!pr) return [3 /*break*/, 12]; - return [4 /*yield*/, this._context.github.repos.getContents(__assign({}, repo, { ref: pr.head.ref, path: match.file }))]; - case 7: - head_response = _b.sent(); - head_content = Buffer.from(head_response.data.content, 'base64').toString(); - return [4 /*yield*/, match.manager.detect(head_content)]; - case 8: - deps = _b.sent(); - if (!this._onlyNew) return [3 /*break*/, 11]; - base = { repo: pr.base.repo.name, owner: pr.base.repo.owner.login }; - return [4 /*yield*/, this._context.github.repos.getContents(__assign({}, base, { path: match.file }))]; - case 9: - base_response = _b.sent(); - base_content = Buffer.from(base_response.data.content, 'base64').toString(); - return [4 /*yield*/, match.manager.detect(base_content)]; - case 10: - base_deps = _b.sent(); - baseDepsKeys = base_deps.map(function (x) { return x.name; }); - deps = deps.filter(function (x) { return baseDepsKeys.indexOf(x.name) < 0; }); - _b.label = 11; - case 11: return [3 /*break*/, 15]; - case 12: return [4 /*yield*/, this._context.github.repos.getContents(__assign({}, repo, { ref: ref, path: match.file }))]; - case 13: - repo_response = _b.sent(); - repo_content = Buffer.from(repo_response.data.content, 'base64').toString(); - return [4 /*yield*/, match.manager.detect(repo_content)]; - case 14: - deps = _b.sent(); - _b.label = 15; - case 15: return [4 /*yield*/, match.manager.lookup(deps)]; - case 16: - deps_lookup = _b.sent(); - for (_a = 0, deps_lookup_1 = deps_lookup; _a < deps_lookup_1.length; _a++) { - dd = deps_lookup_1[_a]; - res = { - label: "Detected **[" + dd.name + "](" + dd.url + ")** as a dependency in **" + match.file + "**, " + (dd.license ? "licensed under: **[" + dd.license + "](https://spdx.org/licenses/" + dd.license + ".html)**" : 'With an unknown license'), - result: this._licenseBanned(dd.license), - dependency: dd - }; - if (res.result === "failure" /* Failure */) { - res.description = "This dependency is distributed under a license which is not allowed on this project - **this pull request can therefore not be merged**"; - } - else { - res.description = "please [review it](" + dd.url + ") and confirm you wish to introduce this to the codebase"; - } - this.result.push(res); - } - return [3 /*break*/, 18]; - case 17: - ex_1 = _b.sent(); - this.result.push({ - label: "Could not process **" + match.file + "** for new dependencies", - result: "warning" /* Warning */ - }); - return [3 /*break*/, 18]; - case 18: - _i++; - return [3 /*break*/, 5]; - case 19: return [2 /*return*/, this.result]; - } - }); - }); - }; - Lookup.prototype.summary = function () { - if (this._summary == null) { - this._summary = { - Success: this.result.filter(function (x) { return x.result == "success" /* Success */; }), - Failure: this.result.filter(function (x) { return x.result == "failure" /* Failure */; }), - Warning: this.result.filter(function (x) { return x.result == "warning" /* Warning */; }) - }; - } - return this._summary; - }; - Lookup.prototype.render = function (incudeDescription) { - if (incudeDescription === void 0) { incudeDescription = true; } - var icon = function (status) { - switch (status) { - case "success" /* Success */: - return '✅'; - case "failure" /* Failure */: - return '❌'; - case "warning" /* Warning */: - return '⚠️'; - default: - return 'ℹ️'; - } - }; - var resolutions = []; - if (this.result) { - for (var _i = 0, _a = this.result; _i < _a.length; _i++) { - var subResult = _a[_i]; - resolutions.push("#### " + icon(subResult.result) + " " + subResult.label); - if (subResult.dependency && incudeDescription) { - if (subResult.result === "failure" /* Failure */) { - resolutions.push("This dependency is distributed under a license which is not allowed on this project - **this pull request can therefore not be merged**"); - } - else { - resolutions.push("lease [review it](" + subResult.dependency.url + ") and confirm you wish to introduce this to the codebase"); - } - } - } - } - return resolutions.join('\n'); - }; - return Lookup; -}()); -exports.default = Lookup; -//# sourceMappingURL=lookup.js.map \ No newline at end of file diff --git a/lib/license/lookup.js.map b/lib/license/lookup.js.map deleted file mode 100644 index 1f0c054..0000000 --- a/lib/license/lookup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lookup.js","sourceRoot":"","sources":["../../src/license/lookup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,iDAA8C;AAE9C,uDAAsE;AAStE;IAQE,gBAAY,MAAsB,EAAE,OAAgB,EAAG,OAAwB;QAAxB,wBAAA,EAAA,cAAwB;QAN/E,WAAM,GAAG,IAAI,KAAK,EAAW,CAAC;QACtB,aAAQ,GAA2B,IAAI,CAAC;QAExC,aAAQ,GAAa,IAAI,CAAC;QAIhC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC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D,IAAI,WAAW,GAAG,EAAE,CAAC;QAErB,IAAG,IAAI,CAAC,MAAM,EAAC;YAEb,KAAuB,UAAW,EAAX,KAAA,IAAI,CAAC,MAAM,EAAX,cAAW,EAAX,IAAW,EAAC;gBAA/B,IAAM,SAAS,SAAA;gBACf,WAAW,CAAC,IAAI,CAAC,UAAQ,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAI,SAAS,CAAC,KAAO,CAAC,CAAC;gBAEtE,IAAG,SAAS,CAAC,UAAU,IAAI,iBAAiB,EAAC;oBAC3C,IAAG,SAAS,CAAC,MAAM,4BAAuB,EAAC;wBACzC,WAAW,CAAC,IAAI,CAAC,yIAAyI,CAAC,CAAC;qBAC7J;yBAAI;wBACH,WAAW,CAAC,IAAI,CAAC,uBAAqB,SAAS,CAAC,UAAU,CAAC,GAAG,6DAA0D,CAAC,CAAC;qBAC3H;iBACJ;aACF;SACF;QAED,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IACH,aAAC;AAAD,CAAC,AA3LD,IA2LC"} \ No newline at end of file diff --git a/lib/plural.d.ts b/lib/plural.d.ts deleted file mode 100644 index b04943e..0000000 --- a/lib/plural.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function plural(plural: string, singular: string, count: number): string; diff --git a/lib/plural.js b/lib/plural.js deleted file mode 100644 index 41e5c80..0000000 --- a/lib/plural.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function plural(plural, singular, count) { - if (count === 1) { - return singular; - } - else { - return plural; - } -} -exports.plural = plural; -; -//# sourceMappingURL=plural.js.map \ No newline at end of file diff --git a/lib/plural.js.map b/lib/plural.js.map deleted file mode 100644 index e5d58b7..0000000 --- a/lib/plural.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plural.js","sourceRoot":"","sources":["../src/plural.ts"],"names":[],"mappings":";;AAAA,SAAgB,MAAM,CACpB,MAAc,EACd,QAAgB,EAChB,KAAa;IAEb,IAAI,KAAK,KAAK,CAAC,EAAE;QACf,OAAO,QAAQ,CAAC;KACjB;SAAM;QACL,OAAO,MAAM,CAAC;KACf;AACH,CAAC;AAVD,wBAUC;AAAA,CAAC"} \ No newline at end of file diff --git a/lib/pull-request-change.d.ts b/lib/pull-request-change.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/lib/pull-request-change.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/lib/pull-request-change.js b/lib/pull-request-change.js deleted file mode 100644 index 56470a3..0000000 --- a/lib/pull-request-change.js +++ /dev/null @@ -1,166 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var app_1 = require("./config/app"); -var task_runner_1 = require("./task-runner"); -function handlePullRequestChange(context) { - return __awaiter(this, void 0, void 0, function () { - var cfg, CHECKNAME, pullRequest, event, issue, _plural, repo, sha, runner, checkInfo, result, checkResult, summary, _i, _a, r, _b, _c, r, _d, _e, r, resolutions, comments, _f, _g, r, _h, _j, r, _k, _l, r, issue_comments, comment, body; - return __generator(this, function (_m) { - switch (_m.label) { - case 0: return [4 /*yield*/, app_1.getTasksConfig(context)]; - case 1: - cfg = _m.sent(); - CHECKNAME = app_1.AppConfig.checkname; - pullRequest = context.payload.pull_request; - event = context.event; - issue = context.issue(); - _plural = function (plural, singular, count) { - if (count === 1) { - return singular; - } - else { - return plural; - } - }; - // if there is no pull request or the state is not open, no reason to continue - if (!pullRequest || pullRequest.state !== "open") - return [2 /*return*/]; - // no need to rerun checks when a review is requested.. - if (event == "pull_request" && context.payload.action === 'review_requested') - return [2 /*return*/]; - // if this a dimissal of a review, we already handling this elsewhere. - if (event === "pull_request_review" && context.payload.action === "dismissed") - return [2 /*return*/]; - repo = context.repo(); - sha = context.payload.pull_request.head.sha; - runner = new task_runner_1.TaskRunner(app_1.AppConfig, cfg, repo); - checkInfo = { - owner: repo.owner, - repo: repo.repo, - name: CHECKNAME, - head_sha: sha - }; - // In progress feedback - return [4 /*yield*/, context.github.checks.create(__assign({}, checkInfo, { status: "in_progress", output: { - title: "Processing " + runner.tasks.length + " " + _plural("checks", "check", runner.tasks.length), - summary: '' - } }))]; - case 2: - // In progress feedback - _m.sent(); - return [4 /*yield*/, runner.run(context)]; - case 3: - result = _m.sent(); - checkResult = __assign({}, checkInfo, { status: "completed", conclusion: (result.Failure.length == 0) ? "success" : "action_required", completed_at: new Date().toISOString(), output: { - title: "Found " + result.Failure.length + " " + _plural("problems", "problem", result.Failure.length) + ", " + result.Warning.length + " " + _plural("warnings", "warning", result.Failure.length), - summary: '', - text: '' - } }); - summary = []; - for (_i = 0, _a = result.Failure; _i < _a.length; _i++) { - r = _a[_i]; - summary.push(" " + "\u274C" /* Failure */ + " " + r.name); - } - for (_b = 0, _c = result.Warning; _b < _c.length; _b++) { - r = _c[_b]; - summary.push(" " + "\u26A0\uFE0F" /* Warning */ + " " + r.name); - } - for (_d = 0, _e = result.Success; _d < _e.length; _d++) { - r = _e[_d]; - summary.push(" " + "\u2705" /* Success */ + " " + r.name); - } - if (result.Warning.length + result.Failure.length > 0) { - summary.push(""); - summary.push("Details on how to resolve are provided below"); - summary.push(""); - summary.push("----"); - summary.push(""); - } - resolutions = []; - comments = []; - comments.push("## \uD83E\uDD16 " + app_1.AppConfig.appname + " found " + result.Failure.length + " " + _plural("problems", "problem", result.Failure.length) + " , " + result.Warning.length + " " + _plural("warnings", "warning", result.Warning.length)); - comments.push(summary.join('\n')); - comments.push(""); - for (_f = 0, _g = result.Failure; _f < _g.length; _f++) { - r = _g[_f]; - resolutions.push(r.render()); - comments.push(r.render()); - } - for (_h = 0, _j = result.Warning; _h < _j.length; _h++) { - r = _j[_h]; - resolutions.push(r.render()); - comments.push(r.render()); - } - for (_k = 0, _l = result.Success; _k < _l.length; _k++) { - r = _l[_k]; - resolutions.push(r.render()); - } - checkResult.output.summary = summary.join('\n'); - checkResult.output.text = resolutions.join('\n'); - return [4 /*yield*/, context.github.issues.listComments(issue)]; - case 4: - issue_comments = _m.sent(); - comment = issue_comments.data.find(function (comment) { return comment.user.login === app_1.AppConfig.appname + "[bot]"; }); - body = comments.join('\n'); - if (!comment) return [3 /*break*/, 6]; - return [4 /*yield*/, context.github.issues.updateComment(__assign({}, issue, { comment_id: comment.id, body: body }))]; - case 5: - _m.sent(); - return [3 /*break*/, 8]; - case 6: return [4 /*yield*/, context.github.issues.createComment(__assign({}, issue, { body: body }))]; - case 7: - _m.sent(); - _m.label = 8; - case 8: return [2 /*return*/, context.github.checks.create(checkResult)]; - } - }); - }); -} -module.exports = handlePullRequestChange; -//# sourceMappingURL=pull-request-change.js.map \ No newline at end of file diff --git a/lib/pull-request-change.js.map b/lib/pull-request-change.js.map deleted file mode 100644 index cd51158..0000000 --- a/lib/pull-request-change.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pull-request-change.js","sourceRoot":"","sources":["../src/pull-request-change.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,oCAAwD;AAExD,6CAA2C;AAI3C,SAAe,uBAAuB,CAAC,OAAgB;;;;;wBAGzC,qBAAM,oBAAc,CAAC,OAAO,CAAC,EAAA;;oBAAnC,GAAG,GAAG,SAA6B;oBACnC,SAAS,GAAG,eAAS,CAAC,SAAS,CAAC;oBAEhC,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;oBAC3C,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;oBACtB,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;oBAExB,OAAO,GAAG,UAAS,MAAe,EAAE,QAAiB,EAAE,KAAc;wBACzE,IAAG,KAAK,KAAK,CAAC,EAAC;4BACb,OAAO,QAAQ,CAAC;yBACjB;6BAAI;4B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;qBAC9B;oBAED,WAAW,CAAC,MAAO,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACjD,WAAW,CAAC,MAAO,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAG3B,qBAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAA;;oBAAhE,cAAc,GAAG,SAA+C;oBAChE,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,eAAS,CAAC,OAAO,GAAG,OAAO,EAAlD,CAAkD,CAAC,CAAC;oBAClG,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;yBAE9B,OAAO,EAAP,wBAAO;oBACR,qBAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,cAAM,KAAK,IAAE,UAAU,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,IAAG,EAAA;;oBAA3F,SAA2F,CAAC;;wBAE5F,qBAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,cAAM,KAAK,IAAE,IAAI,EAAE,IAAI,IAAG,EAAA;;oBAAnE,SAAmE,CAAC;;wBAGxE,sBAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAC;;;;CAClD;AAED,MAAM,CAAC,OAAO,GAAG,uBAAuB,CAAC"} \ No newline at end of file diff --git a/lib/repository-added.d.ts b/lib/repository-added.d.ts deleted file mode 100644 index 782ddfd..0000000 --- a/lib/repository-added.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Context } from "probot"; -declare function repositoryAdded(context: Context): Promise; -export { repositoryAdded }; diff --git a/lib/repository-added.js b/lib/repository-added.js deleted file mode 100644 index e967f91..0000000 --- a/lib/repository-added.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var app_1 = require("./config/app"); -var license_1 = __importDefault(require("./tasks/license")); -function repositoryAdded(context) { - return __awaiter(this, void 0, void 0, function () { - var installs, _i, installs_1, install, repo, repo_data, licfg, licenseTask, issueBody; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(context.payload.action === 'added' && - context.payload.repositories_added.length > 0)) return [3 /*break*/, 6]; - installs = context.payload.repositories_added; - _i = 0, installs_1 = installs; - _a.label = 1; - case 1: - if (!(_i < installs_1.length)) return [3 /*break*/, 6]; - install = installs_1[_i]; - repo = { owner: install.full_name.split("/")[0], repo: install.name }; - return [4 /*yield*/, context.github.repos.get(__assign({}, repo))]; - case 2: - repo_data = _a.sent(); - licfg = { - onNolicense: "warning" /* Warning */, - onNotFound: "success" /* Success */, - baseLicense: repo_data.data.license.spdx_id, - enabled: true - }; - licenseTask = new license_1.default({ appconfig: app_1.AppConfig, config: licfg, repo: repo, organization: null }); - licenseTask.description = "Dependencies found in the current codebase"; - return [4 /*yield*/, licenseTask.run(context)]; - case 3: - _a.sent(); - issueBody = licenseTask.render({ includeHeader: false, includeDescription: true, addCheckBox: true }); - return [4 /*yield*/, context.github.issues.create(__assign({}, repo, { title: "Dependencies", body: issueBody }))]; - case 4: - _a.sent(); - _a.label = 5; - case 5: - _i++; - return [3 /*break*/, 1]; - case 6: return [2 /*return*/]; - } - }); - }); -} -exports.repositoryAdded = repositoryAdded; -//# sourceMappingURL=repository-added.js.map \ No newline at end of file diff --git a/lib/repository-added.js.map b/lib/repository-added.js.map deleted file mode 100644 index f62c142..0000000 --- a/lib/repository-added.js.map +++ /dev/null @@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a,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;oBAE5G,qBAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,cAAM,IAAI,IAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,IAAG,EAAA;;oBAAvF,SAAuF,CAAC;;;oBAnBrE,IAAQ,CAAA;;;;;;CAsBhC;AAEQ,0CAAe"} \ No newline at end of file diff --git a/lib/set-status-pass.d.ts b/lib/set-status-pass.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/lib/set-status-pass.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/lib/set-status-pass.js b/lib/set-status-pass.js deleted file mode 100644 index 0fd3116..0000000 --- a/lib/set-status-pass.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var app_1 = require("./config/app"); -function setStatusPass(context) { - return __awaiter(this, void 0, void 0, function () { - var repo, sha, checkInfo; - return __generator(this, function (_a) { - repo = context.repo(); - sha = context.payload.pull_request.head.sha; - checkInfo = { - owner: repo.owner, - repo: repo.repo, - name: app_1.AppConfig.checkname, - head_sha: sha - }; - return [2 /*return*/, context.github.checks.create(__assign({}, checkInfo, { status: "completed", conclusion: 'success', completed_at: new Date().toISOString(), output: { - title: app_1.AppConfig.checkname, - summary: 'Check was manually approved.' - } }))]; - }); - }); -} -module.exports = setStatusPass; -//# sourceMappingURL=set-status-pass.js.map \ No newline at end of file diff --git a/lib/set-status-pass.js.map b/lib/set-status-pass.js.map deleted file mode 100644 index f558037..0000000 --- a/lib/set-status-pass.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"set-status-pass.js","sourceRoot":"","sources":["../src/set-status-pass.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,oCAAwC;AAGxC,SAAe,aAAa,CAAE,OAAiB;;;;YAEvC,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;YACpB,GAAG,GAAK,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,IAAtC,CAAuC;YAC5C,SAAS,GAAG;gBAChB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,eAAS,CAAC,SAAS;gBACzB,QAAQ,EAAE,GAAG;aAAC,CAAC;YAEjB,sBAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,cAC5B,SAAS,IACZ,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,SAAS,EACrB,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EACtC,MAAM,EAAE;wBACN,KAAK,EAAE,eAAS,CAAC,SAAS;wBAC1B,OAAO,EAAE,8BAA8B;qBACxC,IACD,EAAC;;;CACN;AAED,MAAM,CAAC,OAAO,GAAG,aAAa,CAAC"} \ No newline at end of file diff --git a/lib/task-runner.d.ts b/lib/task-runner.d.ts deleted file mode 100644 index 33460bf..0000000 --- a/lib/task-runner.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ITaskRunnerResults } from "./interfaces/itaskrunnerresult"; -import { IAppConfig } from "./interfaces/config/iappconfig"; -import { ITaskConfig } from "./interfaces/config/itaskconfig"; -import { Context } from "probot"; -import { BaseTask } from "./tasks/base"; -import { ITaskRunnerParams } from "./interfaces/params/itaskrunnerparams"; -export declare class TaskRunner { - appconfig: IAppConfig; - taskconfig: ITaskConfig; - repo: { - repo: string; - owner: string; - }; - tasks: Array<[string, any]>; - organization: string | null; - constructor(params: ITaskRunnerParams); - loadRunners(): Promise>>; - run(context: Context): Promise; -} diff --git a/lib/task-runner.js b/lib/task-runner.js deleted file mode 100644 index f0a4136..0000000 --- a/lib/task-runner.js +++ /dev/null @@ -1,132 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var TaskRunner = /** @class */ (function () { - function TaskRunner(params) { - this.appconfig = params.appconfig; - this.taskconfig = params.taskconfig; - this.repo = params.repo; - this.tasks = Object.entries(this.taskconfig).filter(function (x) { return x[1].enabled; }); - this.organization = params.organization; - } - TaskRunner.prototype.loadRunners = function () { - return __awaiter(this, void 0, void 0, function () { - var runners, _i, _a, task, taskname, tConfig, params, t, ex_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - runners = new Array(); - _i = 0, _a = this.tasks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 6]; - task = _a[_i]; - taskname = task[0]; - tConfig = task[1]; - params = { - appconfig: this.appconfig, - config: tConfig, - repo: this.repo, - organization: this.organization - }; - _b.label = 2; - case 2: - _b.trys.push([2, 4, , 5]); - return [4 /*yield*/, Promise.resolve().then(function () { return __importStar(require(params.appconfig.tasksdirectory + taskname)); })]; - case 3: - t = new ((_b.sent()).default)(params); - if (t !== null) { - runners.push(t); - } - return [3 /*break*/, 5]; - case 4: - ex_1 = _b.sent(); - console.log(ex_1); - return [3 /*break*/, 5]; - case 5: - _i++; - return [3 /*break*/, 1]; - case 6: return [2 /*return*/, runners]; - } - }); - }); - }; - TaskRunner.prototype.run = function (context) { - return __awaiter(this, void 0, void 0, function () { - var results, runners, _i, runners_1, runner, result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - results = new Array(); - return [4 /*yield*/, this.loadRunners()]; - case 1: - runners = _a.sent(); - _i = 0, runners_1 = runners; - _a.label = 2; - case 2: - if (!(_i < runners_1.length)) return [3 /*break*/, 5]; - runner = runners_1[_i]; - return [4 /*yield*/, runner.start(context)]; - case 3: - _a.sent(); - results.push(runner); - _a.label = 4; - case 4: - _i++; - return [3 /*break*/, 2]; - case 5: - result = { - Failure: results.filter(function (x) { return x.summary().Failure.length > 0; }), - Warning: results.filter(function (x) { return x.summary().Warning.length > 0 && x.summary().Failure.length == 0; }), - Success: results.filter(function (x) { return x.summary().Warning.length == 0 && x.summary().Failure.length == 0; }) - }; - return [2 /*return*/, result]; - } - }); - }); - }; - return TaskRunner; -}()); -exports.TaskRunner = TaskRunner; -//# sourceMappingURL=task-runner.js.map \ No newline at end of file diff --git a/lib/task-runner.js.map b/lib/task-runner.js.map deleted file mode 100644 index a1e9616..0000000 --- a/lib/task-runner.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"task-runner.js","sourceRoot":"","sources":["../src/task-runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;IAQE,oBAAY,MAA0B;QACpC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAZ,CAAY,CAAC,CAAC;QACvE,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IAC1C,CAAC;IAEK,gCAAW,GAAjB;;;;;;wBAEQ,OAAO,GAAG,IAAI,KAAK,EAAiB,CAAC;8BAEf,EAAV,KAAA,IAAI,CAAC,KAAK;;;6BAAV,CAAA,cAAU,CAAA;wBAAlB,IAAI;wBAER,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;wBACnB,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;wBAId,MAAM,GAAsB;4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C,MAAM,IAAI,CAAC,EAAjE,CAAiE,CAAC;4BAChG,OAAO,EAAG,OAAO,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAlE,CAAkE,CAAC;yBAClG,CAAA;wBAED,sBAAO,MAAM,EAAC;;;;KAEf;IACH,iBAAC;AAAD,CAAC,AAjED,IAiEC;AAjEY,gCAAU"} \ No newline at end of file diff --git a/lib/tasks/approvals.d.ts b/lib/tasks/approvals.d.ts deleted file mode 100644 index 7e14524..0000000 --- a/lib/tasks/approvals.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Context } from "probot"; -import { BaseTask } from "./base"; -import { ITaskParams } from "../interfaces/params/itaskparams"; -import { IApprovalsConfig } from "../interfaces/config/iapprovalsconfig"; -export default class FourEyePrincipleTask extends BaseTask { - constructor(params: ITaskParams); - run(context: Context): Promise; - unique: (value: any, index: number, self: any[]) => boolean; - getCommitAuthors(context: Context, pr_author: string): Promise; - getReviews(context: Context, coauthors: Array, state: string): Promise<{ - approvals: Array; - contributing: Array; - }>; - getRepoMembershipStatus(owner: string, repo: string, login: string, context: Context): Promise; - getOrgMembershipStatus(org: string, login: string, context: Context): Promise; -} diff --git a/lib/tasks/approvals.js b/lib/tasks/approvals.js deleted file mode 100644 index 192c2b3..0000000 --- a/lib/tasks/approvals.js +++ /dev/null @@ -1,256 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var base_1 = require("./base"); -var plural_1 = require("../plural"); -var FourEyePrincipleTask = /** @class */ (function (_super) { - __extends(FourEyePrincipleTask, _super); - function FourEyePrincipleTask(params) { - var _this = _super.call(this, params) || this; - _this.unique = function (value, index, self) { - return self.indexOf(value) === index; - }; - _this.name = "Approvals"; - _this.description = "All proposed changes must be reviewed by project maintainers before they can be merged"; - _this.resolution = "Not enough people have approved this pull request - please ensure that XXX, who have not contributed to this pull request approve the changes."; - _this.postAsComment = true; - return _this; - } - FourEyePrincipleTask.prototype.run = function (context) { - return __awaiter(this, void 0, void 0, function () { - var author, directCollaborator, approvals, coAuthors, reviews, _i, _a, apr, missingApprovals; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - author = context.payload.pull_request.user.login; - directCollaborator = false; - if (!this.organization) return [3 /*break*/, 2]; - return [4 /*yield*/, this.getOrgMembershipStatus(this.organization, author, context)]; - case 1: - directCollaborator = _b.sent(); - return [3 /*break*/, 4]; - case 2: return [4 /*yield*/, this.getRepoMembershipStatus(this.repo.owner, this.repo.repo, author, context)]; - case 3: - directCollaborator = _b.sent(); - _b.label = 4; - case 4: - approvals = 0; - return [4 /*yield*/, this.getCommitAuthors(context, author)]; - case 5: - coAuthors = _b.sent(); - return [4 /*yield*/, this.getReviews(context, coAuthors, "approved")]; - case 6: - reviews = _b.sent(); - // get current approvals - approvals = reviews.approvals.length; - if (directCollaborator && this.config.includeAuthor) { - this.result.push({ - label: "Approved by PR author @" + author, - result: "success" /* Success */ - }); - approvals++; - } - for (_i = 0, _a = reviews.approvals; _i < _a.length; _i++) { - apr = _a[_i]; - this.result.push({ - label: "Approved by team member @" + apr, - result: "success" /* Success */ - }); - } - if (reviews.contributing.length > 0) { - this.result.push({ - label: plural_1.plural('Approvals', 'Approval', reviews.contributing.length) + " from " + reviews.contributing.map(function (x) { return "@" + x; }).join(", ") + " was excluded as the pull request contains changes from " + plural_1.plural('those users', 'this user', reviews.contributing.length), - result: "warning" /* Warning */ - }); - } - if (approvals < this.config.minimum) { - missingApprovals = this.config.minimum - approvals; - this.result.push({ - label: missingApprovals + " additional " + plural_1.plural('approvals', 'approval', missingApprovals) + " needed", - result: "failure" /* Failure */ - }); - this.resolution = this.resolution.replace('XXX', plural_1.plural(missingApprovals.toString() + " additional users", "1 additional user", missingApprovals)); - } - return [2 /*return*/, true]; - } - }); - }); - }; - FourEyePrincipleTask.prototype.getCommitAuthors = function (context, pr_author) { - return __awaiter(this, void 0, void 0, function () { - var pr, response; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - pr = context.payload.pull_request; - return [4 /*yield*/, context.github.repos.compareCommits(__assign({}, this.repo, { base: pr.base.sha, head: pr.head.sha }))]; - case 1: - response = _a.sent(); - /* - const response = await context.github.pullRequests.listCommits({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - number: context.payload.pull_request.number - });*/ - response.data.commits; - // get all contributin users - except where the contribution is made via the suggestion feature, as this is reviwed - // by the original author before including - so co-authored commits can be exluded - return [2 /*return*/, response.data.commits - .filter(function (data) { return data !== null && data.author !== null && data.author.login; }) - .filter(function (data) { return data.commit.message.indexOf("Co-Authored-By: " + pr_author) < 0; }) - .filter(function (data) { return (data.commit.committer.login !== 'Github' && data.commit.message.indexOf("Merge branch '" + pr.base.ref + "' into") < 0); }) - .map(function (data) { return data.author.login; }) - .filter(this.unique)]; - } - }); - }); - }; - FourEyePrincipleTask.prototype.getReviews = function (context, coauthors, state) { - return __awaiter(this, void 0, void 0, function () { - var response, reviews, contributingReviews, non_contributingReviews, _i, contributingReviews_1, review; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, context.github.pullRequests.listReviews({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - number: context.payload.pull_request.number - })]; - case 1: - response = _a.sent(); - reviews = response.data - .filter(function (x) { return x.state.toLowerCase() === state; }); - contributingReviews = reviews.filter(function (review) { return coauthors.indexOf(review.user.login) >= 0; }); - non_contributingReviews = reviews.filter(function (review) { return coauthors.indexOf(review.user.login) < 0; }); - _i = 0, contributingReviews_1 = contributingReviews; - _a.label = 2; - case 2: - if (!(_i < contributingReviews_1.length)) return [3 /*break*/, 5]; - review = contributingReviews_1[_i]; - return [4 /*yield*/, context.github.pullRequests.dismissReview({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - number: context.payload.pull_request.number, - review_id: review.id, - message: "@" + review.user.login + " is contributing to this pull request and can therefore not review the proposed changes" - })]; - case 3: - _a.sent(); - _a.label = 4; - case 4: - _i++; - return [3 /*break*/, 2]; - case 5: return [2 /*return*/, { - contributing: contributingReviews.map(function (x) { return x.user.login; }).filter(this.unique), - approvals: non_contributingReviews.map(function (x) { return x.user.login; }).filter(this.unique) - }]; - } - }); - }); - }; - FourEyePrincipleTask.prototype.getRepoMembershipStatus = function (owner, repo, login, context) { - return __awaiter(this, void 0, void 0, function () { - var response, permission; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, context.github.repos.getCollaboratorPermissionLevel({ owner: owner, repo: repo, username: login })]; - case 1: - response = _a.sent(); - permission = response.data.permission; - return [2 /*return*/, (permission === "write" || permission === "admin")]; - } - }); - }); - }; - FourEyePrincipleTask.prototype.getOrgMembershipStatus = function (org, login, context) { - return __awaiter(this, void 0, void 0, function () { - var isOrgMember, isMemberOfRepositoryOrganisation, ex_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - isOrgMember = false; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, context.github.orgs.getMembership({ - org: org, - username: login - })]; - case 2: - isMemberOfRepositoryOrganisation = _a.sent(); - if (isMemberOfRepositoryOrganisation.data && - isMemberOfRepositoryOrganisation.data.state === "active") { - isOrgMember = true; - } - return [3 /*break*/, 4]; - case 3: - ex_1 = _a.sent(); - // if the request fails, the member is not found.. - isOrgMember = false; - return [3 /*break*/, 4]; - case 4: return [2 /*return*/, isOrgMember]; - } - }); - }); - }; - return FourEyePrincipleTask; -}(base_1.BaseTask)); -exports.default = FourEyePrincipleTask; -//# sourceMappingURL=approvals.js.map \ No newline at end of file diff --git a/lib/tasks/approvals.js.map b/lib/tasks/approvals.js.map deleted file mode 100644 index 439912b..0000000 --- a/lib/tasks/approvals.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"approvals.js","sourceRoot":"","sources":["../../src/tasks/approvals.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAkC;AAGlC,oCAAmC;AAGnC;IAAkD,wCAA0B;IAE1E,8BAAY,MAAsC;QAAlD,YACE,kBAAM,MAAM,CAAC,SAMd;QA6DD,YAAM,GAAG,UAAC,KAAW,EAAE,KAAc,EAAE,IAAiB;YACtD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;QACvC,CAAC,CAAA;QAnEC,KAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,KAAI,CAAC,WAAW,GAAI,wFAAwF,CAAC;QAC7G,KAAI,CAAC,UAAU,GAAG,gJAAgJ,CAAC;QACnK,KAAI,CAAC,aAAa,GAAG,IAAI,CAAC;;IAC5B,CAAC;IAEK,kCAAG,GAAT,UAAU,OAAgB;;;;;;wBAElB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;wBACnD,kBAAkB,GAAG,KAAK,CAAC;6BAE5B,IAAI,CAAC,YAAY,EAAjB,wBAAiB;wBACG,qBAAM,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAA;;wBAA1F,kBAAkB,GAAG,SAAqE,C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AC,KAAK,CAAC,8BAA8B,CAAC,EAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAA;;wBAAlH,QAAQ,GAAG,SAAuG;wBAClH,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC;wBAE5C,sBAAO,CAAE,UAAU,KAAK,OAAO,IAAI,UAAU,KAAK,OAAO,CAAC,EAAC;;;;KAC5D;IAEK,qDAAsB,GAA5B,UAA6B,GAAW,EAAE,KAAa,EAAE,OAAiB;;;;;;wBACpE,WAAW,GAAG,KAAK,CAAC;;;;wBAGmB,qBAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAC9E;gCACE,GAAG,EAAE,GAAG;gCACR,QAAQ,EAAE,KAAK;6BAChB,CACF,EAAA;;wBALK,gCAAgC,GAAG,SAKxC;wBAED,IACE,gCAAgC,CAAC,IAAI;4BACrC,gCAAgC,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,EACxD;4BACA,WAAW,GAAG,IAAI,CAAC;yBACpB;;;;wBAGD,mDAAmD;wBACnD,WAAW,GAAG,KAAK,CAAC;;4BAGtB,sBAAO,WAAW,EAAC;;;;KACpB;IACH,2BAAC;AAAD,CAAC,AAnKD,CAAkD,eAAQ,GAmKzD"} \ No newline at end of file diff --git a/lib/tasks/base.d.ts b/lib/tasks/base.d.ts deleted file mode 100644 index ec123f9..0000000 --- a/lib/tasks/base.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ITask } from "../interfaces/itask"; -import { Context } from "probot"; -import { IResult } from "../interfaces/iresult"; -import { IResultSummary } from "../interfaces/iresultsummary"; -import { IAppConfig } from "../interfaces/config/iappconfig"; -import { ITaskParams } from "../interfaces/params/itaskparams"; -export declare abstract class BaseTask implements ITask { - name: string; - description: string; - resolution: string; - result: IResult[]; - postAsComment: boolean; - appconfig: IAppConfig; - config: T; - repo: { - repo: string; - owner: string; - }; - organization: string | null; - private _summary; - constructor(params: ITaskParams); - start(context: Context): Promise; - run(context: Context): Promise; - summary(): IResultSummary; - success(): boolean; - render(options?: { - includeDescription: boolean; - includeHeader: boolean; - addCheckBox: boolean; - }): string; -} diff --git a/lib/tasks/base.js b/lib/tasks/base.js deleted file mode 100644 index 0b89614..0000000 --- a/lib/tasks/base.js +++ /dev/null @@ -1,133 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var BaseTask = /** @class */ (function () { - function BaseTask(params) { - this.name = ""; - this.description = ""; - this.resolution = ""; - this.result = new Array(); - this.postAsComment = false; - this._summary = null; - this.appconfig = params.appconfig; - this.config = params.config; - this.repo = params.repo; - this.result = new Array(); - this.organization = params.organization; - } - BaseTask.prototype.start = function (context) { - return __awaiter(this, void 0, void 0, function () { - var ex_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, this.run(context)]; - case 1: - _a.sent(); - return [3 /*break*/, 3]; - case 2: - ex_1 = _a.sent(); - this.result.push({ result: "warning" /* Warning */, description: ex_1, label: "Task failed" }); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); - }; - BaseTask.prototype.run = function (context) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, true]; - }); - }); - }; - BaseTask.prototype.summary = function () { - if (this._summary == null) { - this._summary = { - Success: this.result.filter(function (x) { return x.result == "success" /* Success */; }), - Failure: this.result.filter(function (x) { return x.result == "failure" /* Failure */; }), - Warning: this.result.filter(function (x) { return x.result == "warning" /* Warning */; }) - }; - } - return this._summary; - }; - BaseTask.prototype.success = function () { - return !(this.summary().Failure.length > 0 || this.summary().Warning.length > 0); - }; - BaseTask.prototype.render = function (options) { - if (options === void 0) { options = { includeDescription: true, includeHeader: true, addCheckBox: false }; } - var icon = function (status) { - switch (status) { - case "success" /* Success */: - return "\u2705" /* Success */; - case "failure" /* Failure */: - return "\u274C" /* Failure */; - case "warning" /* Warning */: - return "\u2139\uFE0F" /* Warning */; - default: - return 'ℹ️'; - } - }; - var resolutions = []; - if (options.includeHeader) { - resolutions.push("## " + this.name); - if (this.description && this.description !== '') { - resolutions.push("" + this.description); - } - if (!this.success() && this.resolution && this.resolution !== '') { - resolutions.push(" "); - resolutions.push("**" + this.resolution + "**"); - } - } - if (this.result) { - resolutions.push(""); - for (var _i = 0, _a = this.result; _i < _a.length; _i++) { - var subResult = _a[_i]; - resolutions.push("- " + ((options.addCheckBox && subResult.result !== "success" /* Success */) ? "[ ]" : "") + " " + icon(subResult.result) + " " + subResult.label); - if (options.includeDescription && subResult.description) { - resolutions.push(" " + subResult.description); - } - } - } - resolutions.push(" "); - return resolutions.join('\n'); - }; - return BaseTask; -}()); -exports.BaseTask = BaseTask; -//# sourceMappingURL=base.js.map \ No newline at end of file diff --git a/lib/tasks/base.js.map b/lib/tasks/base.js.map deleted file mode 100644 index 9fea4c7..0000000 --- a/lib/tasks/base.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/tasks/base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;IAeE,kBAAa,MAAuB;QAdpC,SAAI,GAAG,EAAE,CAAC;QACV,gBAAW,GAAG,EAAE,CAAC;QACjB,eAAU,GAAG,EAAE,CAAC;QAEhB,WAAM,GAAG,IAAI,KAAK,EAAW,CAAC;QAC9B,kBAAa,GAAG,KAAK,CAAC;QAOd,aAAQ,GAA2B,IAAI,CAAC;QAG9C,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,KAAK,EAAW,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IAC1C,CAAC;IAEK,wBAAK,GAAX,UAAY,OAAgB;;;;;;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I,CAAC,QAAQ,CAAC,CAAC;QAC3B,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IACH,eAAC;AAAD,CAAC,AAtGD,IAsGC;AAtGqB,4BAAQ"} \ No newline at end of file diff --git a/lib/tasks/foureyeprinciple.d.ts b/lib/tasks/foureyeprinciple.d.ts deleted file mode 100644 index 8ad4d9e..0000000 --- a/lib/tasks/foureyeprinciple.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Context } from "probot"; -import { BaseTask } from "./base"; -export default class FourEyePrincipleTask extends BaseTask { - constructor(); - run(context: Context, config: any): Promise; - getReviewsWithState(context: Context, state: String): Promise; - getOrgMembershipStatus(org: string, login: string, context: Context): Promise; -} diff --git a/lib/tasks/foureyeprinciple.js b/lib/tasks/foureyeprinciple.js deleted file mode 100644 index 44720d6..0000000 --- a/lib/tasks/foureyeprinciple.js +++ /dev/null @@ -1,147 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var base_1 = require("./base"); -var FourEyePrincipleTask = /** @class */ (function (_super) { - __extends(FourEyePrincipleTask, _super); - function FourEyePrincipleTask() { - var _this = _super.call(this) || this; - _this.name = "Four eye principle"; - _this.description = "Ensures that all contributions are reviewed by 2 Zalando employees"; - _this.resolution = "Please ensure that XXX current employees have reviewed and approved this pull request"; - return _this; - } - FourEyePrincipleTask.prototype.run = function (context, config) { - return __awaiter(this, void 0, void 0, function () { - var repo, author, isOrgMember, approvals; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - repo = context.repo(); - author = context.payload.pull_request.head.user.login; - return [4 /*yield*/, this.getOrgMembershipStatus(repo.owner, author, context)]; - case 1: - isOrgMember = _a.sent(); - return [4 /*yield*/, this.getReviewsWithState(context, "approved")]; - case 2: - approvals = _a.sent(); - if (approvals >= config.internal.numberOfReviews && approvals >= config.external.numberOfReviews) { - return [2 /*return*/, true]; - } - if (isOrgMember) { - this.result.push({ - label: approvals + " approvals out of " + config.internal.numberOfReviews + " required", - success: (approvals >= config.internal.numberOfReviews) - }); - this.resolution = this.resolution.replace('XXX', config.internal.numberOfReviews); - } - else { - this.result.push({ - label: approvals + " approvals out of " + config.external.numberOfReviews + " required", - success: (approvals >= config.external.numberOfReviews) - }); - this.resolution = this.resolution.replace('XXX', config.external.numberOfReviews); - } - return [2 /*return*/, true]; - } - }); - }); - }; - FourEyePrincipleTask.prototype.getReviewsWithState = function (context, state) { - return __awaiter(this, void 0, void 0, function () { - var response; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, context.github.pullRequests.listReviews({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - number: context.payload.pull_request.number - })]; - case 1: - response = _a.sent(); - return [2 /*return*/, response.data - .map(function (review) { return review.state; }) - .filter(function (word) { return word.toLowerCase() === state; }).length]; - } - }); - }); - }; - FourEyePrincipleTask.prototype.getOrgMembershipStatus = function (org, login, context) { - return __awaiter(this, void 0, void 0, function () { - var isOrgMember, isMemberOfRepositoryOrganisation, ex_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - isOrgMember = false; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, context.github.orgs.getMembership({ - org: org, - username: login - })]; - case 2: - isMemberOfRepositoryOrganisation = _a.sent(); - if (isMemberOfRepositoryOrganisation.data && - isMemberOfRepositoryOrganisation.data.state === "active") { - isOrgMember = true; - } - return [3 /*break*/, 4]; - case 3: - ex_1 = _a.sent(); - // if the request fails, the member is not found.. - isOrgMember = false; - return [3 /*break*/, 4]; - case 4: return [2 /*return*/, isOrgMember]; - } - }); - }); - }; - return FourEyePrincipleTask; -}(base_1.BaseTask)); -exports.default = FourEyePrincipleTask; -//# sourceMappingURL=foureyeprinciple.js.map \ No newline at end of file diff --git a/lib/tasks/foureyeprinciple.js.map b/lib/tasks/foureyeprinciple.js.map deleted file mode 100644 index fc1d638..0000000 --- a/lib/tasks/foureyeprinciple.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"foureyeprinciple.js","sourceRoot":"","sources":["../../src/tasks/foureyeprinciple.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAkC;AAElC;IAAkD,wCAAQ;IAGxD;QAAA,YACE,iBAAO,SAKR;QAHC,KAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,KAAI,CAAC,WAAW,GAAI,oEAAoE,CAAC;QACzF,KAAI,CAAC,UAAU,GAAG,uFAAuF,CAAC;;IAC5G,CAAC;IAEK,kCAAG,GAAT,UAAU,OAAgB,EAAE,MAAW;;;;;;wBAE/B,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;wBACtB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;wBACxC,qBAAM,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAA;;wBAA5E,WAAW,GAAG,SAA8D;wBAGhE,qBAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,EAAA;;wBAA/D,SAAS,GAAG,SAAmD;wBAErE,IAAG,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,eAAe,IAAI,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAC;4BAC9F,sBAAO,IAAI,EAAC;yBACb;wBAED,IAAG,WAAW,EAAC;4BAEb,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gCACf,KAAK,EAAK,SAAS,0BAAqB,MAAM,CAAC,QAAQ,CAAC,eAAe,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B,UAA6B,GAAW,EAAE,KAAa,EAAE,OAAiB;;;;;;wBACpE,WAAW,GAAG,KAAK,CAAC;;;;wBAGmB,qBAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAC9E;gCACE,GAAG,EAAE,GAAG;gCACR,QAAQ,EAAE,KAAK;6BAChB,CACF,EAAA;;wBALK,gCAAgC,GAAG,SAKxC;wBAED,IACE,gCAAgC,CAAC,IAAI;4BACrC,gCAAgC,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,EACxD;4BACA,WAAW,GAAG,IAAI,CAAC;yBACpB;;;;wBAGD,mDAAmD;wBACnD,WAAW,GAAG,KAAK,CAAC;;4BAGtB,sBAAO,WAAW,EAAC;;;;KACpB;IACH,2BAAC;AAAD,CAAC,AApFD,CAAkD,eAAQ,GAoFzD"} \ No newline at end of file diff --git a/lib/tasks/largecommits.d.ts b/lib/tasks/largecommits.d.ts deleted file mode 100644 index 16bdf6f..0000000 --- a/lib/tasks/largecommits.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Context } from "probot"; -import { BaseTask } from "./base"; -import { PullRequestsListFilesResponse } from "@octokit/rest"; -import { ITaskParams } from "../interfaces/params/itaskparams"; -export default class LargeCommits extends BaseTask { - constructor(params: ITaskParams); - run(context: Context): Promise; - unique: (value: any, index: number, self: any[]) => boolean; - getFiles(context: Context): Promise; - getOrgMembershipStatus(org: string, login: string, context: Context): Promise; -} diff --git a/lib/tasks/largecommits.js b/lib/tasks/largecommits.js deleted file mode 100644 index f3342cb..0000000 --- a/lib/tasks/largecommits.js +++ /dev/null @@ -1,139 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var base_1 = require("./base"); -var LargeCommits = /** @class */ (function (_super) { - __extends(LargeCommits, _super); - function LargeCommits(params) { - var _this = _super.call(this, params) || this; - _this.unique = function (value, index, self) { - return self.indexOf(value) === index; - }; - _this.name = "Large Commits"; - _this.description = "Checks all commits for large additions to a single file. Large commits should be reviewed more carefully for potential copyright and licensing issues"; - _this.resolution = "This file contains a substantial change, please review to determine if the change comes from an external source and if there are any copyright or licensing issues to be aware of"; - _this.postAsComment = true; - return _this; - } - LargeCommits.prototype.run = function (context) { - return __awaiter(this, void 0, void 0, function () { - var files, allFiles, _i, allFiles_1, file; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.getFiles(context)]; - case 1: - files = _a.sent(); - allFiles = files.filter(function (x) { return x.additions > _this.config.maxLines || x.changes > _this.config.maxLines; }); - for (_i = 0, allFiles_1 = allFiles; _i < allFiles_1.length; _i++) { - file = allFiles_1[_i]; - this.result.push({ - label: "[" + file.filename + "](/" + file.blob_url + ") had +" + this.config.maxLines + " lines of code changed in a single commit", - result: "warning" /* Warning */, - description: "Please review this file to determine the source of this change" - }); - } - return [2 /*return*/, true]; - } - }); - }); - }; - LargeCommits.prototype.getFiles = function (context) { - return __awaiter(this, void 0, void 0, function () { - var response; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, context.github.pullRequests.listFiles({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - number: context.payload.pull_request.number - })]; - case 1: - response = _a.sent(); - return [2 /*return*/, response.data]; - } - }); - }); - }; - LargeCommits.prototype.getOrgMembershipStatus = function (org, login, context) { - return __awaiter(this, void 0, void 0, function () { - var isOrgMember, isMemberOfRepositoryOrganisation, ex_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - isOrgMember = false; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, context.github.orgs.getMembership({ - org: org, - username: login - })]; - case 2: - isMemberOfRepositoryOrganisation = _a.sent(); - if (isMemberOfRepositoryOrganisation.data && - isMemberOfRepositoryOrganisation.data.state === "active") { - isOrgMember = true; - } - return [3 /*break*/, 4]; - case 3: - ex_1 = _a.sent(); - // if the request fails, the member is not found.. - isOrgMember = false; - return [3 /*break*/, 4]; - case 4: return [2 /*return*/, isOrgMember]; - } - }); - }); - }; - return LargeCommits; -}(base_1.BaseTask)); -exports.default = LargeCommits; -//# sourceMappingURL=largecommits.js.map \ No newline at end of file diff --git a/lib/tasks/largecommits.js.map b/lib/tasks/largecommits.js.map deleted file mode 100644 index e9970a5..0000000 --- a/lib/tasks/largecommits.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"largecommits.js","sourceRoot":"","sources":["../../src/tasks/largecommits.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAkC;AAKlC;IAA0C,gCAAa;IAErD,sBAAY,MAAyB;QAArC,YACE,kBAAM,MAAM,CAAC,SAMd;QAiBD,YAAM,GAAG,UAAC,KAAW,EAAE,KAAc,EAAE,IAAiB;YACtD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;QACvC,CAAC,CAAA;QAvBC,KAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,KAAI,CAAC,WAAW,GAAI,uJAAuJ,CAAC;QAC5K,KAAI,CAAC,UAAU,GAAG,mLAAmL,CAAC;QACtM,KAAI,CAAC,aAAa,GAAG,IAAI,CAAC;;IAC5B,CAAC;IAEK,0BAAG,GAAT,UAAU,OAAgB;;;;;;4BACZ,qBAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAA;;wBAApC,KAAK,GAAG,SAA4B;wBACpC,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,SAAS,GAAG,KAAI,CAAC,MAAM,CAAC,QAAQ,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D,mDAAmD;wBACnD,WAAW,GAAG,KAAK,CAAC;;4BAGtB,sBAAO,WAAW,EAAC;;;;KACpB;IACH,mBAAC;AAAD,CAAC,AAlED,CAA0C,eAAQ,GAkEjD"} \ No newline at end of file diff --git a/lib/tasks/license.d.ts b/lib/tasks/license.d.ts deleted file mode 100644 index bb00ffa..0000000 --- a/lib/tasks/license.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Context } from "probot"; -import { BaseTask } from "./base"; -import { ILicenseConfig } from "../interfaces/config/ilicenseconfig"; -import { ITaskParams } from "../interfaces/params/itaskparams"; -export default class LicenseTask extends BaseTask { - constructor(params: ITaskParams); - checkComments(context: Context, pull: any): Promise; - run(context: Context): Promise; -} diff --git a/lib/tasks/license.js b/lib/tasks/license.js deleted file mode 100644 index 3e428e4..0000000 --- a/lib/tasks/license.js +++ /dev/null @@ -1,100 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var base_1 = require("./base"); -var lookup_1 = __importDefault(require("../license/lookup")); -var LicenseTask = /** @class */ (function (_super) { - __extends(LicenseTask, _super); - function LicenseTask(params) { - var _this = _super.call(this, params) || this; - _this.name = "Dependency Licensing"; - _this.description = "All dependencies specified in package manager files must be reviewed, banned dependency licenses will block the merge, all new dependencies introduced in this pull request will give a warning, but not block the merge"; - _this.resolution = "Please ensure that only dependencies with licenses compatible with the license of this project is included in the pull request."; - _this.postAsComment = true; - return _this; - } - LicenseTask.prototype.checkComments = function (context, pull) { - return __awaiter(this, void 0, void 0, function () { - var comments, comment; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, context.github.issues.listComments(pull)]; - case 1: - comments = _a.sent(); - comment = comments.data.find(function (comment) { return comment.user.login === process.env.APP_NAME + "[bot]"; }); - return [2 /*return*/, comment]; - } - }); - }); - }; - LicenseTask.prototype.run = function (context) { - return __awaiter(this, void 0, void 0, function () { - var pullRequest, lookup, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - pullRequest = context.payload.pull_request; - lookup = new lookup_1.default(this.config, context); - _a = this; - return [4 /*yield*/, lookup.run(this.repo, pullRequest.base.ref, pullRequest)]; - case 1: - _a.result = _b.sent(); - return [2 /*return*/, true]; - } - }); - }); - }; - return LicenseTask; -}(base_1.BaseTask)); -exports.default = LicenseTask; -//# sourceMappingURL=license.js.map \ No newline at end of file diff --git a/lib/tasks/license.js.map b/lib/tasks/license.js.map deleted file mode 100644 index b2e084c..0000000 --- a/lib/tasks/license.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"license.js","sourceRoot":"","sources":["../../src/tasks/license.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAkC;AAGlC,6DAAuC;AAGvC;IAAyC,+BAAwB;IAE/D,qBAAY,MAAoC;QAAhD,YACE,kBAAM,MAAM,CAAC,SAMd;QAJC,KAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,KAAI,CAAC,WAAW,GAAI,0NAA0N,CAAC;QAC/O,KAAI,CAAC,UAAU,GAAG,iIAAiI,CAAC;QACpJ,KAAI,CAAC,aAAa,GAAG,IAAI,CAAC;;IAC5B,CAAC;IAEK,mCAAa,GAAnB,UAAoB,OAAiB,EAAE,IAAU;;;;;4BAC9B,qBAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAA;;wBAAzD,QAAQ,GAAG,SAA8C;wBACzD,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAChC,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,OAAO,EAArD,CAAqD,CACjE,CAAC;wBAEF,sBAAO,OAAO,EAAC;;;;KAChB;IAEK,yBAAG,GAAT,UAAU,OAAgB;;;;;;wBAElB,WAAW,GAA6B,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;wBAGvE,MAAM,GAAG,IAAI,gBAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;wBAC9C,KAAA,IAAI,CAAA;wBAAU,qBAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,EAAA;;wBAA5E,GAAK,MAAM,GAAG,SAA8D,CAAC;wBAE7E,sBAAO,IAAI,EAAC;;;;KACb;IACH,kBAAC;AAAD,CAAC,AA9BD,CAAyC,eAAQ,GA8BhD"} \ No newline at end of file diff --git a/lib/tasks/risks.d.ts b/lib/tasks/risks.d.ts deleted file mode 100644 index 140f473..0000000 --- a/lib/tasks/risks.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Context } from "probot"; -import { BaseTask } from "./base"; -import { ITaskParams } from "../interfaces/params/itaskparams"; -import { IRisksConfig } from "../interfaces/config/irisksconfig"; -export default class RisksTask extends BaseTask { - constructor(params: ITaskParams); - run(context: Context): Promise; -} diff --git a/lib/tasks/risks.js b/lib/tasks/risks.js deleted file mode 100644 index 2a5ecb7..0000000 --- a/lib/tasks/risks.js +++ /dev/null @@ -1,103 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var base_1 = require("./base"); -var RisksTask = /** @class */ (function (_super) { - __extends(RisksTask, _super); - function RisksTask(params) { - var _this = _super.call(this, params) || this; - _this.name = "Risk Assessment"; - _this.description = "Guides developers to assess the risk of their application by checking the change data and validity of risks.md"; - _this.resolution = "Please ensure you have a risks.md file and it is updated regularly"; - _this.postAsComment = true; - return _this; - } - RisksTask.prototype.run = function (context) { - return __awaiter(this, void 0, void 0, function () { - var riskfile; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, context.github.repos.getContents(__assign({}, this.repo, { path: "risks.md" }))]; - case 1: - riskfile = _a.sent(); - if (riskfile.status !== 200) { - this.result.push({ - label: "No risks.md file found", - result: "failure" /* Failure */, - description: "Create a risks.md file - [Click here](https://" + context.host + "/zincr/risk/" + this.repo.owner + "/" + this.repo.repo + "/)" - }); - } - else { - this.result.push({ - label: "Please update your Risks.md file", - result: "failure" /* Failure */, - description: " [Update your risk assessment](https://" + context.host + "/zincr/risk/" + this.repo.owner + "/" + this.repo.repo + "/)" - }); - } - return [2 /*return*/, true]; - } - }); - }); - }; - return RisksTask; -}(base_1.BaseTask)); -exports.default = RisksTask; -//# sourceMappingURL=risks.js.map \ No newline at end of file diff --git a/lib/tasks/risks.js.map b/lib/tasks/risks.js.map deleted file mode 100644 index d8ea9fb..0000000 --- a/lib/tasks/risks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"risks.js","sourceRoot":"","sources":["../../src/tasks/risks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAkC;AAKlC;IAAuC,6BAAsB;IAE3D,mBAAY,MAAkC;QAA9C,YACE,kBAAM,MAAM,CAAC,SAMd;QAJC,KAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,KAAI,CAAC,WAAW,GAAI,gHAAgH,CAAC;QACrI,KAAI,CAAC,UAAU,GAAG,oEAAoE,CAAC;QACvF,KAAI,CAAC,aAAa,GAAG,IAAI,CAAC;;IAC5B,CAAC;IAGK,uBAAG,GAAT,UAAU,OAAgB;;;;;4BAGP,qBAAM,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,cAAO,IAAI,CAAC,IAAI,IAAE,IAAI,EAAE,UAAU,IAAI,EAAA;;wBAAvF,QAAQ,GAAG,SAA4E;wBAC7F,IAAG,QAAQ,CAAC,MAAM,KAAK,GAAG,EAC1B;4BAEE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gCACf,KAAK,EAAE,wBAAwB;gCAC/B,MAAM,yBAAoB;gCAC1B,WAAW,EAAE,mDAAiD,OAAO,CAAC,IAAI,oBAAe,IAAI,CAAC,IAAI,CAAC,KAAK,SAAI,IAAI,CAAC,IAAI,CAAC,IAAI,OAAI;6BAC/H,CAAC,CAAA;yBAEH;6BAAI;4BAEH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gCACf,KAAK,EAAE,kCAAkC;gCACzC,MAAM,yBAAoB;gCAC1B,WAAW,EAAE,4CAA0C,OAAO,CAAC,IAAI,oBAAe,IAAI,CAAC,IAAI,CAAC,KAAK,SAAI,IAAI,CAAC,IAAI,CAAC,IAAI,OAAI;6BACxH,CAAC,CAAA;yBAEH;wBAED,sBAAO,IAAI,EAAC;;;;KACb;IACH,gBAAC;AAAD,CAAC,AArCD,CAAuC,eAAQ,GAqC9C"} \ No newline at end of file diff --git a/lib/tasks/specification.d.ts b/lib/tasks/specification.d.ts deleted file mode 100644 index fa35909..0000000 --- a/lib/tasks/specification.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Context } from "probot"; -import { BaseTask } from "./base"; -import { ITaskParams } from "../interfaces/params/itaskparams"; -import { ISpecificationConfig } from "../interfaces/config/ispecificationconfig"; -export default class SpecificationTask extends BaseTask { - constructor(params: ITaskParams); - run(context: Context): Promise; -} diff --git a/lib/tasks/specification.js b/lib/tasks/specification.js deleted file mode 100644 index 76eec10..0000000 --- a/lib/tasks/specification.js +++ /dev/null @@ -1,117 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var base_1 = require("./base"); -//import requestPromise = require("request-promise"); -// Patters for issue and url checks -var ISSUE_PATTERN = /(?:\w[\w-.]+\/\w[\w-.]+|\B)#[1-9]\d*\b/; -var URL_PATTERN = /\bhttps?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/i; -var SpecificationTask = /** @class */ (function (_super) { - __extends(SpecificationTask, _super); - function SpecificationTask(params) { - var _this = _super.call(this, params) || this; - _this.name = "Specification"; - _this.description = "All pull requests must follow certain rules for content length and form"; - _this.resolution = "Please ensure the follow issues are resolved:"; - return _this; - } - SpecificationTask.prototype.run = function (context) { - return __awaiter(this, void 0, void 0, function () { - var pr, isLongEnough, containsPattern; - return __generator(this, function (_a) { - pr = context.payload.pull_request; - isLongEnough = function (str, requiredLength) { return (str || '').length > requiredLength; }; - containsPattern = function (pattern, str) { return pattern.test(str); }; - // Check template - // Get template - compare to body - if (this.config.template) { - //const url = `https://raw.githubusercontent.com/${repo.owner}/${repo.repo}/master/.github/PULL_REQUEST_TEMPLATE.md`; - //const template = await requestPromise(url, { resolveWithFullResponse: true }); - } - // Check title - // check min length - if (this.config.title) { - if (this.config.title && this.config.title["minimum-length"] && this.config.title["minimum-length"].enabled !== false) { - this.result.push({ - label: "Pull Request Title must be atleast " + this.config.title["minimum-length"].length + " characters", - result: isLongEnough(pr.title, this.config.title["minimum-length"].length) ? "success" /* Success */ : "failure" /* Failure */ - }); - } - } - // Check body - // check for issue pattern or url pattern - if (this.config.body) { - if (this.config.body && this.config.body["minimum-length"] && this.config.body["minimum-length"].enabled !== false) { - this.result.push({ - label: "Pull Request body must be atleast " + this.config.body["minimum-length"].length + " characters", - result: isLongEnough(pr.body, this.config.body["minimum-length"].length) ? "success" /* Success */ : "failure" /* Failure */ - }); - } - if (this.config.body["contains-issue-number"]) { - this.result.push({ - label: "Pull Request body must contain issue number", - result: ISSUE_PATTERN.test(pr.body) ? "success" /* Success */ : "failure" /* Failure */ - }); - } - if (this.config.body["contains-url"]) { - this.result.push({ - label: "Pull Request body must contain url", - result: containsPattern(URL_PATTERN, pr.body) ? "success" /* Success */ : "failure" /* Failure */ - }); - } - } - return [2 /*return*/, true]; - }); - }); - }; - return SpecificationTask; -}(base_1.BaseTask)); -exports.default = SpecificationTask; -//# sourceMappingURL=specification.js.map \ No newline at end of file diff --git a/lib/tasks/specification.js.map b/lib/tasks/specification.js.map deleted file mode 100644 index 67ab5f8..0000000 --- a/lib/tasks/specification.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"specification.js","sourceRoot":"","sources":["../../src/tasks/specification.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAkC;AAIlC,qDAAqD;AAErD,mCAAmC;AACnC,IAAM,aAAa,GAAG,wCAAwC,CAAC;AAC/D,IAAM,WAAW,GAAG,gGAAgG,CAAC;AAGrH;IAA+C,qCAA8B;IAE3E,2BAAY,MAA0C;QAAtD,YACE,kBAAM,MAAM,CAAC,SAId;QAHC,KAAI,CA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 036c278..0000000 --- a/lib/zincr.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Context } from "probot"; -import { TaskRunner } from "./task-runner"; -import { ITaskConfig } from "./interfaces/config/itaskconfig"; -import { IAppConfig } from "./interfaces/config/iappconfig"; -import { IAppParams } from "./interfaces/params/iappparams"; -export declare class Zincr { - appconfig: IAppConfig; - taskconfig: ITaskConfig; - repo: { - repo: string; - owner: string; - }; - runner: TaskRunner; - organization: string | null; - constructor(params: IAppParams); - onChange(context: Context): Promise; - setStatusPass(context: Context): Promise>; -} diff --git a/lib/zincr.js b/lib/zincr.js deleted file mode 100644 index 60b01ac..0000000 --- a/lib/zincr.js +++ /dev/null @@ -1,194 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var task_runner_1 = require("./task-runner"); -var plural_1 = require("./plural"); -var Zincr = /** @class */ (function () { - function Zincr(params) { - this.appconfig = params.appconfig; - this.taskconfig = params.taskconfig; - this.repo = params.repo; - this.organization = params.organization; - this.runner = new task_runner_1.TaskRunner(params); - } - Zincr.prototype.onChange = function (context) { - return __awaiter(this, void 0, void 0, function () { - var CHECKNAME, pullRequest, event, issue, sha, valid_pr_actions, checkInfo, result, checkResult, summary, _i, _a, r, _b, _c, r, _d, _e, r, resolutions, comments, _f, _g, r, _h, _j, r, _k, _l, r, issue_comments, comment, body; - var _this = this; - return __generator(this, function (_m) { - switch (_m.label) { - case 0: - CHECKNAME = this.appconfig.checkname; - pullRequest = context.payload.pull_request; - event = context.event; - issue = context.issue(); - sha = context.payload.pull_request.head.sha; - valid_pr_actions = ["opened", "edited", "reopened", "synchronize"]; - // if there is no pull request or the state is not open, no reason to continue - if (!pullRequest || pullRequest.state !== "open") - return [2 /*return*/]; - // only trigger on valid PR events - if (event == "pull_request" && - valid_pr_actions.indexOf(context.payload.action) < 0) - return [2 /*return*/]; - // no need to rerun checks when a review is requested.. - if (event == "pull_request" && - context.payload.action === "review_requested") - return [2 /*return*/]; - // if this a dimissal of a review, we already handling this elsewhere. - if (event === "pull_request_review" && - context.payload.action === "dismissed") - return [2 /*return*/]; - checkInfo = { - owner: this.repo.owner, - repo: this.repo.repo, - name: CHECKNAME, - head_sha: sha - }; - // In progress feedback - return [4 /*yield*/, context.github.checks.create(__assign({}, checkInfo, { status: "in_progress", output: { - title: "Processing " + this.runner.tasks.length + " " + plural_1.plural("checks", "check", this.runner.tasks.length), - summary: "" - } }))]; - case 1: - // In progress feedback - _m.sent(); - return [4 /*yield*/, this.runner.run(context)]; - case 2: - result = _m.sent(); - checkResult = __assign({}, checkInfo, { status: "completed", conclusion: result.Failure.length == 0 ? "success" : "action_required", completed_at: new Date().toISOString(), output: { - title: "Found " + result.Failure.length + " " + plural_1.plural("problems", "problem", result.Failure.length) + ", " + result.Warning.length + " " + plural_1.plural("warnings", "warning", result.Failure.length), - summary: "", - text: "" - } }); - summary = []; - for (_i = 0, _a = result.Failure; _i < _a.length; _i++) { - r = _a[_i]; - summary.push(" " + "\u274C" /* Failure */ + " " + r.name); - } - for (_b = 0, _c = result.Warning; _b < _c.length; _b++) { - r = _c[_b]; - summary.push(" " + "\u2139\uFE0F" /* Warning */ + " " + r.name); - } - for (_d = 0, _e = result.Success; _d < _e.length; _d++) { - r = _e[_d]; - summary.push(" " + "\u2705" /* Success */ + " " + r.name); - } - if (result.Warning.length + result.Failure.length > 0) { - summary.push(""); - summary.push("Details on how to resolve are provided below"); - summary.push(""); - summary.push("----"); - summary.push(""); - } - resolutions = []; - comments = []; - comments.push("## \uD83E\uDD16 " + this.appconfig.appname + " found " + result.Failure.length + " " + plural_1.plural("problems", "problem", result.Failure.length) + " , " + result.Warning.length + " " + plural_1.plural("warnings", "warning", result.Warning.length)); - comments.push(summary.join("\n")); - comments.push(""); - for (_f = 0, _g = result.Failure; _f < _g.length; _f++) { - r = _g[_f]; - resolutions.push(r.render()); - comments.push(r.render()); - } - for (_h = 0, _j = result.Warning; _h < _j.length; _h++) { - r = _j[_h]; - resolutions.push(r.render()); - comments.push(r.render()); - } - for (_k = 0, _l = result.Success; _k < _l.length; _k++) { - r = _l[_k]; - resolutions.push(r.render()); - } - checkResult.output.summary = summary.join("\n"); - checkResult.output.text = resolutions.join("\n"); - if (!this.taskconfig.comment) return [3 /*break*/, 7]; - return [4 /*yield*/, context.github.issues.listComments(issue)]; - case 3: - issue_comments = _m.sent(); - comment = issue_comments.data.find(function (comment) { return comment.user.login === _this.appconfig.appname + "[bot]"; }); - body = comments.join("\n"); - if (!comment) return [3 /*break*/, 5]; - return [4 /*yield*/, context.github.issues.updateComment(__assign({}, issue, { comment_id: comment.id, body: body }))]; - case 4: - _m.sent(); - return [3 /*break*/, 7]; - case 5: return [4 /*yield*/, context.github.issues.createComment(__assign({}, issue, { body: body }))]; - case 6: - _m.sent(); - _m.label = 7; - case 7: return [4 /*yield*/, context.github.checks.create(checkResult)]; - case 8: - _m.sent(); - return [2 /*return*/]; - } - }); - }); - }; - Zincr.prototype.setStatusPass = function (context) { - return __awaiter(this, void 0, void 0, function () { - var sha, checkInfo; - return __generator(this, function (_a) { - sha = context.payload.pull_request.head.sha; - checkInfo = { - owner: this.repo.owner, - repo: this.repo.repo, - name: this.appconfig.checkname, - head_sha: sha - }; - return [2 /*return*/, context.github.checks.create(__assign({}, checkInfo, { status: "completed", conclusion: 'success', completed_at: new Date().toISOString(), output: { - title: this.appconfig.checkname, - summary: 'Check was manually approved.' - } }))]; - }); - }); - }; - return Zincr; -}()); -exports.Zincr = Zincr; -//# sourceMappingURL=zincr.js.map \ No newline at end of file diff --git a/lib/zincr.js.map b/lib/zincr.js.map deleted file mode 100644 index 67074de..0000000 --- a/lib/zincr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zincr.js","sourceRoot":"","sources":["../src/zincr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;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c3abf7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "zincr", - "version": "1.0.5", + "version": "1.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 06db08f..ba9c52e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zincr", - "version": "1.0.5", + "version": "1.0.6", "description": "Compliance and Security Checker", "author": "Per Ploug ", "license": "MIT",