Upgrade dev dependencies, clean lint (#1151)

Looks like eslint 4 adds `no-useless-escape` and `no-self-compare` to `eslint:recommended`.
This commit is contained in:
Paul Melnikow
2017-10-12 15:57:29 -04:00
committed by GitHub
parent 200bb11ed3
commit 7f385fb361
3 changed files with 91 additions and 89 deletions

View File

@@ -114,7 +114,9 @@ function handleRequest (vendorRequestHandler) {
const cacheControl = res.headers['cache-control'];
if (cacheControl != null) {
const age = cacheControl.match(/max-age=([0-9]+)/);
if ((age != null) && (+age[1] === +age[1])) {
// Would like to get some more test coverage on this before changing it.
// eslint-disable-next-line no-self-compare
if (age != null && (+age[1] === +age[1])) {
cacheInterval = +age[1] * 1000;
}
}

View File

@@ -69,7 +69,7 @@
"devDependencies": {
"child-process-promise": "^2.2.1",
"dejavu-fonts-ttf": "^2.37.3",
"eslint": "^3.18.0",
"eslint": "^4.8.0",
"eslint-config-prettier": "^2.6.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.7.0",
@@ -89,11 +89,11 @@
"node-fetch": "^1.6.3",
"nyc": "^11.2.1",
"opn-cli": "^3.1.0",
"prettier": "1.7.3",
"prettier": "1.7.4",
"read-all-stdin-sync": "^1.0.5",
"rimraf": "^2.6.2",
"semver-regex": "^1.0.0",
"sinon": "^2.1.0"
"sinon": "^4.0.1"
},
"engines": {
"node": ">= 6"

170
server.js
View File

@@ -155,7 +155,7 @@ camp.notfound(/.*/, function(query, match, end, request) {
// Vendors.
// JIRA issue integration
camp.route(/^\/jira\/issue\/(http(?:s)?)\/(.+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/jira\/issue\/(http(?:s)?)\/(.+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function (data, match, sendBadge, request) {
var protocol = match[1]; // eg, https
var host = match[2]; // eg, issues.apache.org/jira
@@ -213,7 +213,7 @@ cache(function (data, match, sendBadge, request) {
}));
// JIRA agile sprint completion integration
camp.route(/^\/jira\/sprint\/(http(?:s)?)\/(.+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/jira\/sprint\/(http(?:s)?)\/(.+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function (data, match, sendBadge, request) {
var protocol = match[1]; // eg, https
var host = match[2]; // eg, jira.spring.io
@@ -269,7 +269,7 @@ cache(function (data, match, sendBadge, request) {
}));
// Travis integration
camp.route(/^\/travis(-ci)?\/([^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/travis(-ci)?\/([^/]+\/[^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var userRepo = match[2]; // eg, espadrine/sc
var branch = match[3];
@@ -311,7 +311,7 @@ cache(function(data, match, sendBadge, request) {
}));
// continuousphp integration
camp.route(/^\/continuousphp\/([^\/]+)\/([^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/continuousphp\/([^/]+)\/([^/]+\/[^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var provider = match[1];
var userRepo = match[2];
@@ -371,7 +371,7 @@ cache(function(data, match, sendBadge, request) {
}));
// NetflixOSS metadata integration
camp.route(/^\/osslifecycle?\/([^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/osslifecycle?\/([^/]+\/[^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var orgOrUserAndRepo = match[1];
var branch = match[2];
@@ -397,7 +397,7 @@ camp.route(/^\/osslifecycle?\/([^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json
return;
}
try {
var matchStatus = body.match(/osslifecycle\=([a-z]+)/im);
var matchStatus = body.match(/osslifecycle=([a-z]+)/im);
if (matchStatus === null) {
badgeData.text[1] = 'inaccessible';
sendBadge(format, badgeData);
@@ -416,7 +416,7 @@ camp.route(/^\/osslifecycle?\/([^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json
}));
// Shippable integration
camp.route(/^\/shippable\/([^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/shippable\/([^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function (data, match, sendBadge, request) {
var defaultOpts = {
colorA: '#555555',
@@ -664,7 +664,7 @@ cache(function (data, match, sendBadge, request) {
}));
// AppVeyor CI integration.
camp.route(/^\/appveyor\/ci\/([^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/appveyor\/ci\/([^/]+\/[^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var repo = match[1]; // eg, `gruntjs/grunt`.
var branch = match[2];
@@ -706,7 +706,7 @@ cache(function(data, match, sendBadge, request) {
}));
// AppVeyor test status integration.
camp.route(/^\/appveyor\/tests\/([^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/appveyor\/tests\/([^/]+\/[^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var repo = match[1]; // eg, `gruntjs/grunt`.
var branch = match[2];
@@ -1124,7 +1124,7 @@ cache(function(data, match, sendBadge, request) {
// Bountysource integration.
camp.route(/^\/bountysource\/team\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/bountysource\/team\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var team = match[1]; // eg, `mozilla-core`.
var type = match[2]; // eg, `activity`.
@@ -1155,7 +1155,7 @@ cache(function(data, match, sendBadge, request) {
}));
// HHVM integration.
camp.route(/^\/hhvm\/([^\/]+\/[^\/]+)(\/.+)?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/hhvm\/([^/]+\/[^/]+)(\/.+)?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, `symfony/symfony`.
var branch = match[2];// eg, `/2.4.0.0`.
@@ -1196,7 +1196,7 @@ cache(function(data, match, sendBadge, request) {
}));
// SensioLabs.
camp.route(/^\/sensiolabs\/i\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/sensiolabs\/i\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var projectUuid = match[1];
var format = match[2];
@@ -1224,8 +1224,8 @@ cache(function(data, match, sendBadge, request) {
return;
}
var matchStatus = body.match(/\<status\>\<\!\[CDATA\[([a-z]+)\]\]\>\<\/status\>/im);
var matchGrade = body.match(/\<grade\>\<\!\[CDATA\[([a-z]+)\]\]\>\<\/grade\>/im);
var matchStatus = body.match(/<status><!\[CDATA\[([a-z]+)\]\]><\/status>/im);
var matchGrade = body.match(/<grade><!\[CDATA\[([a-z]+)\]\]><\/grade>/im);
if (matchStatus === null) {
badgeData.text[1] = 'inaccessible';
@@ -1581,7 +1581,7 @@ cache(function (data, match, sendBadge, request) {
}));
// npm version integration.
camp.route(/^\/npm\/v\/(@[^\/]*)?\/?([^\/]*)\/?([^\/]*)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/npm\/v\/(@[^/]*)?\/?([^/]*)\/?([^/]*)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var scope = match[1]; // "@user"
var repo = match[2]; // "express"
@@ -1621,7 +1621,7 @@ cache(function(data, match, sendBadge, request) {
}));
// npm license integration.
camp.route(/^\/npm\/l\/(?:@([^\/]+)\/)?([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/npm\/l\/(?:@([^/]+)\/)?([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
const scope = match[1]; // "user" (when a scope "@user" is supplied)
const packageName = match[2]; // "express"
@@ -1722,7 +1722,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Anaconda Cloud / conda package manager integration
camp.route(/^\/conda\/([dvp]n?)\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/conda\/([dvp]n?)\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(queryData, match, sendBadge, request) {
const mode = match[1];
const channel = match[2];
@@ -2051,7 +2051,7 @@ cache(function(data, match, sendBadge, request) {
}));
// PyPI integration.
camp.route(/^\/pypi\/([^\/]+)\/(.*)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/pypi\/([^/]+)\/(.*)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var info = match[1];
var egg = match[2]; // eg, `gevent`, `Django`.
@@ -2146,7 +2146,7 @@ cache(function(data, match, sendBadge, request) {
sendBadge(format, badgeData);
} else if (info === 'pyversions') {
var versions = [];
let pattern = /^Programming Language \:\: Python \:\: ([\d\.]+)$/;
let pattern = /^Programming Language :: Python :: ([\d.]+)$/;
for (let i = 0; i < data.info.classifiers.length; i++) {
var matched = pattern.exec(data.info.classifiers[i]);
if (matched && matched[1]) {
@@ -2170,7 +2170,7 @@ cache(function(data, match, sendBadge, request) {
sendBadge(format, badgeData);
} else if (info === 'implementation') {
var implementations = [];
let pattern = /^Programming Language \:\: Python \:\: Implementation \:\: (\S+)$/;
let pattern = /^Programming Language :: Python :: Implementation :: (\S+)$/;
for (let i = 0; i < data.info.classifiers.length; i++) {
let matched = pattern.exec(data.info.classifiers[i]);
if (matched && matched[1]) {
@@ -2185,7 +2185,7 @@ cache(function(data, match, sendBadge, request) {
badgeData.colorscheme = 'blue';
sendBadge(format, badgeData);
} else if (info === 'status') {
let pattern = /^Development Status \:\: ([1-7]) - (\S+)$/;
let pattern = /^Development Status :: ([1-7]) - (\S+)$/;
var statusColors = {
'1': 'red', '2': 'red', '3': 'red', '4': 'yellow',
'5': 'brightgreen', '6': 'brightgreen', '7': 'red'};
@@ -2311,7 +2311,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Hex.pm integration.
camp.route(/^\/hexpm\/([^\/]+)\/(.*)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/hexpm\/([^/]+)\/(.*)\.(svg|png|gif|jpg|json)$/,
cache(function(queryParams, match, sendBadge, request) {
const info = match[1];
const repo = match[2]; // eg, `httpotion`.
@@ -2370,7 +2370,7 @@ cache(function(queryParams, match, sendBadge, request) {
}));
// Coveralls integration.
camp.route(/^\/coveralls\/([^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/coveralls\/([^/]+\/[^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var userRepo = match[1]; // eg, `jekyll/jekyll`.
var branch = match[2];
@@ -2420,7 +2420,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Codecov integration.
camp.route(/^\/codecov\/c\/(?:token\/(\w+))?[+\/]?([^\/]+\/[^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/codecov\/c\/(?:token\/(\w+))?[+/]?([^/]+\/[^/]+\/[^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var token = match[1];
var userRepo = match[2]; // eg, `github/codecov/example-python`.
@@ -2849,7 +2849,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Codacy integration
camp.route(/^\/codacy\/(?:grade\/)?(?!coverage\/)([^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/codacy\/(?:grade\/)?(?!coverage\/)([^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var projectId = match[1]; // eg. e27821fb6289410b8f58338c7e0bc686
var branch = match[2];
@@ -2898,7 +2898,7 @@ cache(function(data, match, sendBadge, request) {
}));
// ReadTheDocs build
camp.route(/^\/readthedocs\/([^\/]+)(?:\/(.+))?.(svg|png|gif|jpg|json)$/,
camp.route(/^\/readthedocs\/([^/]+)(?:\/(.+))?.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var project = match[1];
var version = match[2];
@@ -2934,7 +2934,7 @@ cache(function(data, match, sendBadge, request) {
});
}));
camp.route(/^\/codacy\/coverage\/(?!grade\/)([^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/codacy\/coverage\/(?!grade\/)([^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var projectId = match[1]; // eg. e27821fb6289410b8f58338c7e0bc686
var branch = match[2];
@@ -3211,7 +3211,7 @@ cache(function (data, match, sendBadge, request) {
}));
// GitHub tag integration.
camp.route(/^\/github\/tag\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/tag\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, expressjs/express
var repo = match[2];
@@ -3243,7 +3243,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub package and manifest version integration.
camp.route(/^\/github\/(package|manifest)-json\/([^\/]+)\/([^\/]+)\/([^\/]+)\/?([^\/]+)?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/(package|manifest)-json\/([^/]+)\/([^/]+)\/([^/]+)\/?([^/]+)?\.(svg|png|gif|jpg|json)$/,
cache(function(query_data, match, sendBadge, request) {
var type = match[1];
var info = match[2];
@@ -3288,7 +3288,7 @@ cache(function(query_data, match, sendBadge, request) {
}));
// GitHub contributors integration.
camp.route(/^\/github\/contributors(-anon)?\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/contributors(-anon)?\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var isAnon = match[1];
var user = match[2];
@@ -3324,7 +3324,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub release integration
camp.route(/^\/github\/release\/([^\/]+\/[^\/]+)(?:\/(all))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/release\/([^/]+\/[^/]+)(?:\/(all))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var userRepo = match[1]; // eg, qubyte/rubidium
var allReleases = match[2];
@@ -3368,7 +3368,7 @@ mapGithubReleaseDate(camp, githubApiUrl, githubAuth);
mapGithubCommitsSince(camp, githubApiUrl ,githubAuth);
// GitHub release-download-count and pre-release-download-count integration.
camp.route(/^\/github\/(downloads|downloads-pre)\/([^\/]+)\/([^\/]+)(\/.+)?\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/(downloads|downloads-pre)\/([^/]+)\/([^/]+)(\/.+)?\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
const type = match[1]; // downloads or downloads-pre
var user = match[2]; // eg, qubyte/rubidium
@@ -3447,7 +3447,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub issues integration.
camp.route(/^\/github\/issues(-pr)?(-closed)?(-raw)?\/([^\/]+)\/([^\/]+)\/?([^\/]+)?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/issues(-pr)?(-closed)?(-raw)?\/([^/]+)\/([^/]+)\/?([^/]+)?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var isPR = !!match[1];
var isClosed = !!match[2];
@@ -3494,7 +3494,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub issue detail integration.
camp.route(/^\/github\/(?:issues|pulls)\/detail\/(s|title|u|label|comments|age|last-update)\/([^\/]+)\/([^\/]+)\/(\d+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/(?:issues|pulls)\/detail\/(s|title|u|label|comments|age|last-update)\/([^/]+)\/([^/]+)\/(\d+)\.(svg|png|gif|jpg|json)$/,
cache((queryParams, match, sendBadge, request) => {
const [, which, owner, repo, number, format] = match;
const uri = `${githubApiUrl}/repos/${owner}/${repo}/issues/${number}`;
@@ -3563,7 +3563,7 @@ cache((queryParams, match, sendBadge, request) => {
}));
// GitHub pull request build status integration.
camp.route(/^\/github\/status\/(s|contexts)\/pulls\/([^\/]+)\/([^\/]+)\/(\d+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/status\/(s|contexts)\/pulls\/([^/]+)\/([^/]+)\/(\d+)\.(svg|png|gif|jpg|json)$/,
cache((queryParams, match, sendBadge, request) => {
const [, which, owner, repo, number, format] = match;
const issueUri = `${githubApiUrl}/repos/${owner}/${repo}/pulls/${number}`;
@@ -3613,7 +3613,7 @@ cache((queryParams, match, sendBadge, request) => {
}));
// GitHub forks integration.
camp.route(/^\/github\/forks\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/forks\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, qubyte/rubidium
var repo = match[2];
@@ -3648,7 +3648,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub stars integration.
camp.route(/^\/github\/stars\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/stars\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, qubyte/rubidium
var repo = match[2];
@@ -3681,7 +3681,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub watchers integration.
camp.route(/^\/github\/watchers\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/watchers\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, qubyte/rubidium
var repo = match[2];
@@ -3714,7 +3714,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub user followers integration.
camp.route(/^\/github\/followers\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/followers\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, qubyte
var format = match[2];
@@ -3742,7 +3742,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub license integration.
camp.route(/^\/github\/license\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/license\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, mashape
var repo = match[2]; // eg, apistatus
@@ -3794,7 +3794,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub file size.
camp.route(/^\/github\/size\/([^\/]+)\/([^\/]+)\/(.*)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/size\/([^/]+)\/([^/]+)\/(.*)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, mashape
var repo = match[2]; // eg, apistatus
@@ -3836,7 +3836,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub search hit counter.
camp.route(/^\/github\/search\/([^\/]+)\/([^\/]+)\/(.*)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/search\/([^/]+)\/([^/]+)\/(.*)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1];
var repo = match[2];
@@ -3868,7 +3868,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub commit statistics integration.
camp.route(/^\/github\/commit-activity\/(y|4w|w)\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/commit-activity\/(y|4w|w)\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
const interval = match[1];
const user = match[2];
@@ -3917,7 +3917,7 @@ cache(function(data, match, sendBadge, request) {
}));
// GitHub last commit integration.
camp.route(/^\/github\/last-commit\/([^\/]+)\/([^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/github\/last-commit\/([^/]+)\/([^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
const user = match[1]; // eg, mashape
const repo = match[2]; // eg, apistatus
@@ -4017,7 +4017,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Bitbucket issues integration.
camp.route(/^\/bitbucket\/issues(-raw)?\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/bitbucket\/issues(-raw)?\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var isRaw = !!match[1];
var user = match[2]; // eg, atlassian
@@ -4047,7 +4047,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Bitbucket pull requests integration.
camp.route(/^\/bitbucket\/pr(-raw)?\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/bitbucket\/pr(-raw)?\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var isRaw = !!match[1];
var user = match[2]; // eg, atlassian
@@ -4141,7 +4141,7 @@ mapNugetFeed(camp, '(.+\\.)?myget\\/(.*)', 2, function(match) {
});
// Puppet Forge modules
camp.route(/^\/puppetforge\/([^\/]+)\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/puppetforge\/([^/]+)\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var info = match[1]; // either `v`, `dt`, `e` or `f`
var user = match[2];
@@ -4208,7 +4208,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Puppet Forge users
camp.route(/^\/puppetforge\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/puppetforge\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var info = match[1]; // either `rc` or `mc`
var user = match[2];
@@ -4246,7 +4246,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Jenkins build status integration
camp.route(/^\/jenkins(?:-ci)?\/s\/(http(?:s)?)\/([^\/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/jenkins(?:-ci)?\/s\/(http(?:s)?)\/([^/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var scheme = match[1]; // http(s)
var host = match[2]; // example.org:8080
@@ -4302,7 +4302,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Jenkins tests integration
camp.route(/^\/jenkins(?:-ci)?\/t\/(http(?:s)?)\/([^\/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/jenkins(?:-ci)?\/t\/(http(?:s)?)\/([^/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var scheme = match[1]; // http(s)
var host = match[2]; // example.org:8080
@@ -4362,7 +4362,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Jenkins coverage integration
camp.route(/^\/jenkins(?:-ci)?\/c\/(http(?:s)?)\/([^\/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/jenkins(?:-ci)?\/c\/(http(?:s)?)\/([^/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var scheme = match[1]; // http(s)
var host = match[2]; // example.org:8080
@@ -4453,7 +4453,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Codeship.io integration
camp.route(/^\/codeship\/([^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/codeship\/([^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var projectId = match[1]; // eg, `ab123456-00c0-0123-42de-6f98765g4h32`.
var format = match[3];
@@ -4510,7 +4510,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Magnum CI integration
camp.route(/^\/magnumci\/ci\/([^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/magnumci\/ci\/([^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var projectId = match[1]; // E.g. 96ffb83fa700f069024921b0702e76ff
var branch = match[2]; // E.g. master
@@ -4558,7 +4558,7 @@ cache(function(data, match, sendBadge, request) {
// Maven-Central artifact version integration
// (based on repo1.maven.org rather than search.maven.org because of #846)
camp.route(/^\/maven-central\/v\/([^\/]*)\/([^\/]*)(?:\/([^\/]*))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/maven-central\/v\/([^/]*)\/([^/]*)(?:\/([^/]*))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var groupId = match[1]; // eg, `com.google.inject`
var artifactId = match[2]; // eg, `guice`
@@ -4607,7 +4607,7 @@ cache(function(data, match, sendBadge, request) {
// /nexus/(r|s|<repo-name>)/(http|https)/<nexus.host>[:port][/<entry-path>]/<group>/<artifact>[:k1=v1[:k2=v2[...]]].<format>
// for /nexus/[rs]/... pattern, use the search api of the nexus server, and
// for /nexus/<repo-name>/... pattern, use the resolve api of the nexus server.
camp.route(/^\/nexus\/(r|s|[^\/]+)\/(https?)\/((?:[^\/]+)(?:\/[^\/]+)?)\/([^\/]+)\/([^\/:]+)(:.+)?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/nexus\/(r|s|[^/]+)\/(https?)\/((?:[^/]+)(?:\/[^/]+)?)\/([^/]+)\/([^/:]+)(:.+)?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var repo = match[1]; // r | s | repo-name
var scheme = match[2]; // http | https
@@ -5026,7 +5026,7 @@ cache(function(data, match, sendBadge, request) {
}));
// SourceForge integration.
camp.route(/^\/sourceforge\/([^\/]+)\/([^/]*)\/?(.*).(svg|png|gif|jpg|json)$/,
camp.route(/^\/sourceforge\/([^/]+)\/([^/]*)\/?(.*).(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var info = match[1]; // eg, 'dm'
var project = match[2]; // eg, 'sevenzip`.
@@ -5079,7 +5079,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Requires.io status integration
camp.route(/^\/requires\/([^\/]+\/[^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/requires\/([^/]+\/[^/]+\/[^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var userRepo = match[1]; // eg, `github/celery/celery`.
var branch = match[2];
@@ -5303,7 +5303,7 @@ cache(function(data, match, sendBadge, request) {
// CircleCI build integration.
// https://circleci.com/api/v1/project/BrightFlair/PHP.Gt?circle-token=0a5143728784b263d9f0238b8d595522689b3af2&limit=1&filter=completed
camp.route(/^\/circleci\/(?:token\/(\w+))?[+\/]?project\/(?:(github|bitbucket)\/)?([^\/]+\/[^\/]+)(?:\/(.*))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/circleci\/(?:token\/(\w+))?[+/]?project\/(?:(github|bitbucket)\/)?([^/]+\/[^/]+)(?:\/(.*))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var token = match[1];
var type = match[2] || 'github'; // github OR bitbucket
@@ -5377,7 +5377,7 @@ cache(function(data, match, sendBadge, request) {
}));
// CPAN integration.
camp.route(/^\/cpan\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/cpan\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var info = match[1]; // either `v` or `l`
var pkg = match[2]; // eg, Config-Augeas
@@ -5412,7 +5412,7 @@ cache(function(data, match, sendBadge, request) {
}));
// CRAN/METACRAN integration.
camp.route(/^\/cran\/([vl])\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/cran\/([vl])\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(queryParams, match, sendBadge, request) {
var info = match[1]; // either `v` or `l`
var pkg = match[2]; // eg, devtools
@@ -5461,7 +5461,7 @@ cache(function(queryParams, match, sendBadge, request) {
// CTAN integration.
camp.route(/^\/ctan\/([vl])\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/ctan\/([vl])\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var info = match[1]; // either `v` or `l`
var pkg = match[2]; // eg, tex
@@ -5510,7 +5510,7 @@ cache(function(data, match, sendBadge, request) {
));
// DUB download integration
camp.route(/^\/dub\/(dd|dw|dm|dt)\/([^\/]+)(?:\/([^\/]+))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/dub\/(dd|dw|dm|dt)\/([^/]+)(?:\/([^/]+))?\.(svg|png|gif|jpg|json)$/,
cache(function (data, match, sendBadge, request) {
var info = match[1]; // downloads (dd - daily, dw - weekly, dm - monthly, dt - total)
var pkg = match[2]; // package name, e.g. vibe-d
@@ -5565,7 +5565,7 @@ cache(function (data, match, sendBadge, request) {
}));
// DUB license and version integration
camp.route(/^\/dub\/(v|l)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/dub\/(v|l)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function (data, match, sendBadge, request) {
var info = match[1]; // (v - version, l - license)
var pkg = match[2]; // package name, e.g. vibe-d
@@ -5609,7 +5609,7 @@ cache(function (data, match, sendBadge, request) {
}));
// Docker Hub stars integration.
camp.route(/^\/docker\/stars\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/docker\/stars\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, mashape
var repo = match[2]; // eg, kong
@@ -5640,7 +5640,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Docker Hub pulls integration.
camp.route(/^\/docker\/pulls\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/docker\/pulls\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, mashape
var repo = match[2]; // eg, kong
@@ -5673,7 +5673,7 @@ cache(function(data, match, sendBadge, request) {
// Docker Hub automated integration.
camp.route(/^\/docker\/automated\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/docker\/automated\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, jrottenberg
var repo = match[2]; // eg, ffmpeg
@@ -5710,7 +5710,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Docker Hub automated integration, most recent build's status (passed, pending, failed)
camp.route(/^\/docker\/build\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/docker\/build\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, jrottenberg
var repo = match[2]; // eg, ffmpeg
@@ -5754,7 +5754,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Twitter integration.
camp.route(/^\/twitter\/url\/([^\/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/twitter\/url\/([^/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var scheme = match[1]; // eg, https
var path = match[2]; // eg, shields.io
@@ -5777,7 +5777,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Twitter follow badge.
camp.route(/^\/twitter\/follow\/@?([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/twitter\/follow\/@?([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, shields_io
var format = match[2];
@@ -5817,7 +5817,7 @@ cache(function(data, match, sendBadge, request) {
// Snap CI build integration.
// https://snap-ci.com/snap-ci/snap-deploy/branch/master/build_image
camp.route(/^\/snap(-ci?)\/([^\/]+\/[^\/]+)(?:\/(.+))\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/snap(-ci?)\/([^/]+\/[^/]+)(?:\/(.+))\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var userRepo = match[2];
var branch = match[3];
@@ -5849,7 +5849,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Visual Studio Team Services build integration.
camp.route(/^\/vso\/build\/([^\/]+)\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/vso\/build\/([^/]+)\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var name = match[1]; // User name
var project = match[2]; // Project ID, e.g. 953a34b9-5966-4923-a48a-c41874cfb5f5
@@ -5881,7 +5881,7 @@ cache(function(data, match, sendBadge, request) {
}));
// ImageLayers.io integration.
camp.route(/^\/imagelayers\/(image\-size|layers)\/([^\/]+)\/([^\/]+)\/([^\/]*)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/imagelayers\/(image-size|layers)\/([^/]+)\/([^/]+)\/([^/]*)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var type = match[1];
var user = match[2];
@@ -5926,7 +5926,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Gitter room integration.
camp.route(/^\/gitter\/room\/([^\/]+\/[^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/gitter\/room\/([^/]+\/[^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
// match[1] is the repo, which is not used.
var format = match[2];
@@ -5938,7 +5938,7 @@ cache(function(data, match, sendBadge, request) {
}));
// homebrew integration
camp.route(/^\/homebrew\/v\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/homebrew\/v\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var pkg = match[1]; // eg. cake
var format = match[2];
@@ -5968,7 +5968,7 @@ cache(function(data, match, sendBadge, request) {
}));
// StackExchange integration.
camp.route(/^\/stackexchange\/([^\/]+)\/([^\/])\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/stackexchange\/([^/]+)\/([^/])\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var site = match[1]; // eg, stackoverflow
var info = match[2]; // either `r`
@@ -6051,7 +6051,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Maintenance integration.
camp.route(/^\/maintenance\/([^\/]+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/maintenance\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var status = match[1]; // eg, yes
var year = +match[2]; // eg, 2016
@@ -6106,7 +6106,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Waffle.io integration
camp.route(/^\/waffle\/label\/([^\/]+)\/([^\/]+)\/?([^\/]+)?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/waffle\/label\/([^/]+)\/([^/]+)\/?([^/]+)?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var user = match[1]; // eg, evancohen
var repo = match[2]; // eg, smart-mirror
@@ -6256,7 +6256,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Cauditor integration
camp.route(/^\/cauditor\/(mi|ccn|npath|hi|i|ca|ce|dit)\/([^\/]+)\/([^\/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/cauditor\/(mi|ccn|npath|hi|i|ca|ce|dit)\/([^/]+)\/([^/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var labels = {
'mi': 'maintainability',
@@ -6389,7 +6389,7 @@ cache(function(query_data, match, sendBadge, request) {
}));
// jitPack version integration.
camp.route(/^\/jitpack\/v\/([^\/]*)\/([^\/]*)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/jitpack\/v\/([^/]*)\/([^/]*)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var groupId = 'com.github.' + match[1]; // github user
var artifactId = match[2]; // the project's name
@@ -6473,7 +6473,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Issue Stats integration.
camp.route(/^\/issuestats\/([^\/]+)(\/long)?\/([^\/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/issuestats\/([^/]+)(\/long)?\/([^/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var type = match[1]; // e.g. `i` for Issue or `p` for PR
var longForm = !!match[2];
@@ -6538,7 +6538,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Libraries.io integration.
camp.route(/^\/librariesio\/(github|release)\/([\w\-\_]+\/[\w\-\_]+)\/?([\w\-\_\.]+)?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/librariesio\/(github|release)\/([\w\-_]+\/[\w\-_]+)\/?([\w\-_.]+)?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var resource = match[1];
@@ -6597,7 +6597,7 @@ cache(function(data, match, sendBadge, request) {
}));
// JetBrains Plugins repository integration
camp.route(/^\/jetbrains\/plugin\/(d)\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/jetbrains\/plugin\/(d)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var pluginId = match[2];
var type = match[1];
@@ -6761,7 +6761,7 @@ cache(function(data, match, sendBadge, request) {
// Uptime Robot ratio integration.
// API documentation : https://uptimerobot.com/api
camp.route(/^\/uptimerobot\/ratio(\/[^\/]+)?\/(.*)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/uptimerobot\/ratio(\/[^/]+)?\/(.*)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var numberOfDays = match[1]; // eg, 7, null if querying 30
var monitorApiKey = match[2]; // eg, m778918918-3e92c097147760ee39d02d36
@@ -6826,7 +6826,7 @@ cache(function(data, match, sendBadge, request) {
}));
// Discord integration
camp.route(/^\/discord\/([^\/]+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/discord\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache((data, match, sendBadge, request) => {
const serverID = match[1];
const format = match[2];
@@ -6931,7 +6931,7 @@ camp.route(/^\/flip\.svg$/, function(data, match, end, ask) {
});
// Any badge, old version.
camp.route(/^\/([^\/]+)\/(.+).png$/,
camp.route(/^\/([^/]+)\/(.+).png$/,
function(data, match, end, ask) {
var subject = match[1];
var status = match[2];