hubot-help
Advanced tools
Comparing version 1.0.1 to 1.1.0
{ | ||
"name": "hubot-help", | ||
"description": "A hubot script to show available hubot commands", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"publishConfig": { | ||
@@ -24,26 +24,6 @@ "tag": "next" | ||
}, | ||
"peerDependencies": { | ||
"hubot": ">=2 <10 || 0.0.0-development" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"coveralls": "^2.13.1", | ||
"grunt": "^1.0.1", | ||
"grunt-contrib-watch": "^1.0.0", | ||
"grunt-mocha-test": "^0.7.0", | ||
"grunt-release": "^0.14.0", | ||
"hubot": "^3.0.0", | ||
"hubot-mock-adapter-v3": "^1.0.0", | ||
"matchdep": "^0.1.2", | ||
"mocha": "^3.0.2", | ||
"nyc": "^11.0.3", | ||
"sinon": "^1.4.2", | ||
"sinon-chai": "^2.8.0", | ||
"standard": "^10.0.2", | ||
"semantic-release": "^6.3.6" | ||
}, | ||
"main": "index.coffee", | ||
"main": "index.js", | ||
"scripts": { | ||
"pretest": "standard", | ||
"test": "nyc --reporter=html --reporter=text mocha", | ||
"test": "nyc --reporter=html --reporter=text mocha --exit", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
@@ -55,3 +35,19 @@ "semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
"src" | ||
] | ||
} | ||
], | ||
"devDependencies": { | ||
"chai": "^4.3.7", | ||
"coveralls": "^3.1.1", | ||
"hubot-mock-adapter-v3": "^1.0.1", | ||
"hubot-test-helper": "^1.9.0", | ||
"matchdep": "^2.0.0", | ||
"mocha": "^10.2.0", | ||
"nyc": "^15.1.0", | ||
"semantic-release": "^21.0.2", | ||
"sinon": "^15.0.4", | ||
"sinon-chai": "^3.7.0", | ||
"standard": "^17.0.0" | ||
}, | ||
"dependencies": { | ||
"hubot": "^3.4.0" | ||
} | ||
} |
@@ -8,3 +8,3 @@ Hubot Help Plugin | ||
See [`src/help.coffee`](src/help.coffee) for full documentation. | ||
See [`src/help.js`](src/help.js) for full documentation. | ||
@@ -11,0 +11,0 @@ Installation |
@@ -14,3 +14,3 @@ 'use strict' | ||
// Configuration: | ||
// HUBOT_HELP_REPLY_IN_PRIVATE - if set to any avlue, all `hubot help` replies are sent in private | ||
// HUBOT_HELP_REPLY_IN_PRIVATE - if set to any value, all `hubot help` replies are sent in private | ||
// HUBOT_HELP_DISABLE_HTTP - if set, no web entry point will be declared | ||
@@ -22,4 +22,2 @@ // HUBOT_HELP_HIDDEN_COMMANDS - comma-separated list of commands that will not be displayed in help | ||
/* global renamedHelpCommands */ | ||
const helpContents = (name, commands) => `\ | ||
@@ -65,4 +63,2 @@ <!DOCTYPE html> | ||
module.exports = (robot) => { | ||
const replyInPrivate = process.env.HUBOT_HELP_REPLY_IN_PRIVATE | ||
robot.respond(/help(?:\s+(.*))?$/i, (msg) => { | ||
@@ -82,5 +78,5 @@ let cmds = getHelpCommands(robot) | ||
if (replyInPrivate && msg.message && msg.message.user && msg.message.user.name) { | ||
msg.reply('replied to you in private!') | ||
return robot.send({ room: msg.message.user.name }, emit) | ||
if (process.env.HUBOT_HELP_REPLY_IN_PRIVATE && msg.message && msg.message.user && msg.message.user.name && msg.message.user.name !== msg.message.room) { | ||
msg.reply('I just replied to you in private.') | ||
return robot.send({ room: msg.message.user.id }, emit) | ||
} else { | ||
@@ -93,3 +89,3 @@ return msg.send(emit) | ||
return robot.router.get(`/${robot.name}/help`, (req, res) => { | ||
let cmds = renamedHelpCommands(robot).map(cmd => cmd.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')) | ||
let cmds = getHelpCommands(robot).map(cmd => cmd.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')) | ||
@@ -110,3 +106,3 @@ if (req.query.q != null) { | ||
var getHelpCommands = function getHelpCommands (robot) { | ||
const getHelpCommands = function getHelpCommands (robot) { | ||
let helpCommands = robot.helpCommands() | ||
@@ -131,4 +127,4 @@ | ||
var hiddenCommandsPattern = function hiddenCommandsPattern () { | ||
const hiddenCommands = process.env.HUBOT_HELP_HIDDEN_COMMANDS != null ? process.env.HUBOT_HELP_HIDDEN_COMMANDS.split(',') : undefined | ||
const hiddenCommandsPattern = function hiddenCommandsPattern () { | ||
const hiddenCommands = process.env.HUBOT_HELP_HIDDEN_COMMANDS != null ? process.env.HUBOT_HELP_HIDDEN_COMMANDS.split(',').map(c => c.trim()) : undefined | ||
if (hiddenCommands) { | ||
@@ -135,0 +131,0 @@ return new RegExp(`^hubot (?:${hiddenCommands != null ? hiddenCommands.join('|') : undefined}) - `) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11
6233
114
+ Addedhubot@^3.4.0
+ Addedaccepts@1.3.8(transitive)
+ Addedarray-flatten@1.1.1(transitive)
+ Addedasync@3.2.6(transitive)
+ Addedbasic-auth@2.0.1(transitive)
+ Addedbody-parser@1.20.3(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcline@0.8.2(transitive)
+ Addedcoffeescript@2.7.0(transitive)
+ Addedconnect-multiparty@2.2.0(transitive)
+ Addedcontent-disposition@0.5.4(transitive)
+ Addedcontent-type@1.0.5(transitive)
+ Addedcookie@0.6.0(transitive)
+ Addedcookie-signature@1.0.6(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddepd@1.1.22.0.0(transitive)
+ Addeddestroy@1.2.0(transitive)
+ Addedee-first@1.1.1(transitive)
+ Addedencodeurl@1.0.22.0.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedetag@1.8.1(transitive)
+ Addedexpress@4.21.0(transitive)
+ Addedexpress-basic-auth@1.2.1(transitive)
+ Addedfinalhandler@1.3.1(transitive)
+ Addedforwarded@0.2.0(transitive)
+ Addedfresh@0.5.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttp-errors@1.7.31.8.12.0.0(transitive)
+ Addedhubot@3.5.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedipaddr.js@1.9.1(transitive)
+ Addedlog@1.4.0(transitive)
+ Addedmedia-typer@0.3.0(transitive)
+ Addedmerge-descriptors@1.0.3(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@1.6.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.0.02.1.3(transitive)
+ Addedmultiparty@4.2.3(transitive)
+ Addednegotiator@0.6.3(transitive)
+ Addedobject-inspect@1.13.2(transitive)
+ Addedon-finished@2.3.02.4.1(transitive)
+ Addedoptparse@1.0.5(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedpath-to-regexp@0.1.10(transitive)
+ Addedproxy-addr@2.0.7(transitive)
+ Addedqs@6.13.06.5.3(transitive)
+ Addedrandom-bytes@1.0.0(transitive)
+ Addedrange-parser@1.2.1(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedsafe-buffer@5.1.25.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsend@0.19.0(transitive)
+ Addedserve-static@1.16.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedsetprototypeof@1.1.11.2.0(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedstatuses@1.5.02.0.1(transitive)
+ Addedtoidentifier@1.0.01.0.1(transitive)
+ Addedtype-is@1.6.18(transitive)
+ Addeduid-safe@2.1.5(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addedutils-merge@1.0.1(transitive)
+ Addedvary@1.1.2(transitive)